From e6f662348e7f8aef3d10d8fb9f301d71ff3d2ca7 Mon Sep 17 00:00:00 2001 From: alichinese Date: Thu, 6 Nov 2025 16:44:26 +0800 Subject: [PATCH] feature: add extra repo mirror function * some pkg come from extra repo, so add a feature to add extra repo to repos Signed-off-by: alichinese --- .oebuild/features/oebridge-extra-repo.yaml | 7 +++++++ meta-openeuler/classes/image-oebridge.bbclass | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 .oebuild/features/oebridge-extra-repo.yaml diff --git a/.oebuild/features/oebridge-extra-repo.yaml b/.oebuild/features/oebridge-extra-repo.yaml new file mode 100644 index 00000000000..9c3a3364c2b --- /dev/null +++ b/.oebuild/features/oebridge-extra-repo.yaml @@ -0,0 +1,7 @@ +type: feature + +local_conf: | + DISTRO_FEATURES:append = " oebridge oe-extra " + SERVER_MIRROR = "https://mirrors.tuna.tsinghua.edu.cn/openeuler" + SERVER_VERSION = "openEuler-24.03-LTS" + GLIBC_GENERATE_LOCALES:append = "en_US.UTF-8 zh_CN.UTF-8 " diff --git a/meta-openeuler/classes/image-oebridge.bbclass b/meta-openeuler/classes/image-oebridge.bbclass index d6027a074e7..38a136a1b9d 100644 --- a/meta-openeuler/classes/image-oebridge.bbclass +++ b/meta-openeuler/classes/image-oebridge.bbclass @@ -215,6 +215,13 @@ fakeroot python do_dnf_install_pkgs(){ run_cmd_with_cwd(f"PSEUDO_UNLOAD=1 sudo setfacl --restore=rootfs_permission", d.getVar("WORKDIR")+"/temp") run_cmd_with_cwd(f"cat rootfs_softlink | while read -r o p;do PSEUDO_UNLOAD=1 sudo chown -h \"$o\" \"$p\"; done", d.getVar("WORKDIR")+"/temp") + if "oe-extra" in d.getVar("DISTRO_FEATURES"): + # here add extra repo for installing pkgs from oepkgs.net, but the repo source is extras, like: + # https://repo.oepkgs.net/openeuler/rpm/openEuler-24.03-LTS/extras/aarch64/ + run_cmd_with_cwd(f"PSEUDO_UNLOAD=1 sudo chroot temp/rootfs dnf install \ + dnf-plugins-core -y --nogpgcheck --setopt=sslverify=0 --nobest", d.getVar("WORKDIR")) + extra_mirror = "https://repo.oepkgs.net/openeuler/rpm" + run_cmd_with_cwd(f"PSEUDO_UNLOAD=1 sudo chroot temp/rootfs dnf config-manager --add-repo {extra_mirror}/{d.getVar('SERVER_VERSION')}/extras/{d.getVar('TUNE_ARCH')}/", d.getVar("WORKDIR")) if len(real_list) > 0: real_list_str = " ".join(real_list) run_cmd_with_cwd(f"PSEUDO_UNLOAD=1 sudo chroot temp/rootfs dnf install \ -- Gitee