From 8031ce1626dd513660231a990af4d4f4ecdd4708 Mon Sep 17 00:00:00 2001 From: hanzongcheng Date: Sat, 19 Apr 2025 10:15:27 +0800 Subject: [PATCH] epkg: add epkg 0.3.0 * epkg is a new type of software package format developed by the openEuler community. It supports multiple environments and versions, addressing software package compatibility issues. Signed-off-by: hanzongcheng --- .oebuild/features/epkg.yaml | 4 ++ .oebuild/manifest.yaml | 3 + .../aarch64/kp920-industry-kernel6.yaml | 1 + .oebuild/samples/aarch64/kp920-industry.yaml | 1 + .../samples/aarch64/qemu-aarch64-kernel6.yaml | 1 + .oebuild/samples/aarch64/qemu-aarch64.yaml | 1 + .../packagegroup-core-base-utils.bbappend | 1 + meta-openeuler/recipes-extended/epkg/epkg.bb | 64 +++++++++++++++++++ 8 files changed, 76 insertions(+) create mode 100644 .oebuild/features/epkg.yaml create mode 100644 meta-openeuler/recipes-extended/epkg/epkg.bb diff --git a/.oebuild/features/epkg.yaml b/.oebuild/features/epkg.yaml new file mode 100644 index 00000000000..addd9c0be0b --- /dev/null +++ b/.oebuild/features/epkg.yaml @@ -0,0 +1,4 @@ +type: feature + +local_conf: | + DISTRO_FEATURES:append = " epkg" diff --git a/.oebuild/manifest.yaml b/.oebuild/manifest.yaml index 59358865907..1410f3dd3df 100644 --- a/.oebuild/manifest.yaml +++ b/.oebuild/manifest.yaml @@ -303,6 +303,9 @@ manifest_list: embedded-ipc: remote_url: https://gitee.com/openeuler/embedded-ipc.git version: 1e05e78e3d82fb2ef39e08a9e6fb3ca1cd918fcc + epkg: + remote_url: https://gitee.com/src-openeuler/epkg.git + version: 5b9de44c77acf397758d0c0c35ddcc6c5b0442ee ethercat-igh: remote_url: https://gitee.com/src-openeuler/ethercat-igh.git version: d117d0caba507895d0a8be5ade71f1b43fa470cb diff --git a/.oebuild/samples/aarch64/kp920-industry-kernel6.yaml b/.oebuild/samples/aarch64/kp920-industry-kernel6.yaml index 92f2620294d..e51342db8b7 100644 --- a/.oebuild/samples/aarch64/kp920-industry-kernel6.yaml +++ b/.oebuild/samples/aarch64/kp920-industry-kernel6.yaml @@ -28,6 +28,7 @@ local_conf: |+ GLIBC_GENERATE_LOCALES:append = "en_US.UTF-8 zh_CN.UTF-8 " INIT_MANAGER = "systemd" + DISTRO_FEATURES:append = " epkg" layers: - yocto-meta-openeuler/bsp/meta-kunpeng diff --git a/.oebuild/samples/aarch64/kp920-industry.yaml b/.oebuild/samples/aarch64/kp920-industry.yaml index 43fdc92b559..9549a2ed46a 100644 --- a/.oebuild/samples/aarch64/kp920-industry.yaml +++ b/.oebuild/samples/aarch64/kp920-industry.yaml @@ -24,6 +24,7 @@ local_conf: |+ GLIBC_GENERATE_LOCALES:append = "en_US.UTF-8 zh_CN.UTF-8 " INIT_MANAGER = "systemd" + DISTRO_FEATURES:append = " epkg" layers: - yocto-meta-openeuler/bsp/meta-kunpeng diff --git a/.oebuild/samples/aarch64/qemu-aarch64-kernel6.yaml b/.oebuild/samples/aarch64/qemu-aarch64-kernel6.yaml index f9e8c59f05a..a825b452eba 100644 --- a/.oebuild/samples/aarch64/qemu-aarch64-kernel6.yaml +++ b/.oebuild/samples/aarch64/qemu-aarch64-kernel6.yaml @@ -11,6 +11,7 @@ local_conf: |+ DISTRO_FEATURES:append = " kernel6 " PREFERRED_VERSION_linux-openeuler ?= "6.6%" PREFERRED_VERSION_linux-openeuler-rt ?= "6.6%" + DISTRO_FEATURES:append = " epkg" layers: [] docker_param: diff --git a/.oebuild/samples/aarch64/qemu-aarch64.yaml b/.oebuild/samples/aarch64/qemu-aarch64.yaml index 15845985a99..0f4fbcd7789 100644 --- a/.oebuild/samples/aarch64/qemu-aarch64.yaml +++ b/.oebuild/samples/aarch64/qemu-aarch64.yaml @@ -7,6 +7,7 @@ repos: - yocto-meta-openembedded local_conf: |+ DISTRO_FEATURES:append = " isulad " + DISTRO_FEATURES:append = " epkg" layers: [] docker_param: diff --git a/meta-openeuler/recipes-core/packagegroups/packagegroup-core-base-utils.bbappend b/meta-openeuler/recipes-core/packagegroups/packagegroup-core-base-utils.bbappend index 3b5979dbaff..f1d8030a046 100644 --- a/meta-openeuler/recipes-core/packagegroups/packagegroup-core-base-utils.bbappend +++ b/meta-openeuler/recipes-core/packagegroups/packagegroup-core-base-utils.bbappend @@ -86,6 +86,7 @@ RDEPENDS:${PN} = "\ libusb1 \ glib-2.0 \ libbfd \ + ${@bb.utils.contains('DISTRO_FEATURES', 'epkg', 'epkg', '', d)} \ " # riscv64 arch is not support kexec-tools, view yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.23.bb diff --git a/meta-openeuler/recipes-extended/epkg/epkg.bb b/meta-openeuler/recipes-extended/epkg/epkg.bb new file mode 100644 index 00000000000..2b53fa2974d --- /dev/null +++ b/meta-openeuler/recipes-extended/epkg/epkg.bb @@ -0,0 +1,64 @@ +SUMMARY = "A new type of software package" +DESCRIPTION = "Install epkg" + +PV = "0.3.0" + +SRC_URI += " \ + file://${BPN}-${PV}.tar.gz \ + file://rootfs.tar.gz \ + " + +do_compile[noexec] = "1" + +LICENSE = "MulanPSL-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MulanPSL-2.0;md5=74b1b7a7ee537a16390ed514498bf23c" + +opt_epkg = "${D}/opt/epkg" +cache_root = "${opt_epkg}/cache" +store_root = "${opt_epkg}/store" +common_root = "${opt_epkg}/users/public/envs/common" +pkg_cache = "${opt_epkg}/cache/packages" +channel_cache = "${opt_epkg}/cache/channel" +rc_path = "${D}/etc/profile.d/epkg.sh" + +do_install:append() { + install -d ${opt_epkg} + install -d ${D}/etc/profile.d + install -d ${common_root}/profile-1/usr + install -d ${common_root}/profile-1/usr/lib + install -d ${common_root}/profile-1/etc/epkg + install -d ${common_root}/profile-1/usr/bin + install -d ${common_root}/profile-1/usr/bin + install -d ${cache_root} + + cd ${common_root}/profile-1 + ln -sT usr/bin bin + ln -sT usr/sbin sbin + ln -sT usr/lib lib + ln -sT usr/lib64 lib64 + cd ${common_root}/ + ln -sT profile-1 profile-current + + cp -a ${S} ${cache_root}/epkg-manager + rm -rf ${cache_root}/epkg-manager/target + + cp -a ${S}/bin ${common_root}/profile-1/usr/ + cp -a ${S}/lib/epkg ${common_root}/profile-1/usr/lib/ + cp -a ${S}/build ${opt_epkg} + + install -m 0755 ${S}/channel/openEuler-24.03-LTS-channel.yaml ${common_root}/profile-1/etc/epkg/channel.yaml + install -m 0755 ${WORKDIR}/rootfs/elf-loader-${TARGET_ARCH} ${common_root}/profile-1/usr/bin/elf-loader + install -m 0755 ${WORKDIR}/rootfs/epkg-${TARGET_ARCH} ${common_root}/profile-1/usr/bin/epkg + + chown -R root:root ${opt_epkg} + chmod -R 755 ${opt_epkg} + chmod 4755 ${common_root}/profile-1/usr/bin/epkg + + cat >${rc_path} <