diff --git a/meta-openeuler/recipes-core/psmisc/psmisc.inc b/meta-openeuler/recipes-core/psmisc/psmisc.inc new file mode 100644 index 0000000000000000000000000000000000000000..3b167d56158fa4663045f4638b9659398c624fa5 --- /dev/null +++ b/meta-openeuler/recipes-core/psmisc/psmisc.inc @@ -0,0 +1,36 @@ +SUMMARY = "Utilities for managing processes on your system" +HOMEPAGE = "http://psmisc.sf.net/" +DESCRIPTION = "The psmisc package contains utilities for managing processes on your \ +system: pstree, killall and fuser. The pstree command displays a tree \ +structure of all of the running processes on your system. The killall \ +command sends a specified signal (SIGTERM if nothing is specified) to \ +processes identified by name. The fuser command identifies the PIDs \ +of processes that are using specified files or filesystems." +SECTION = "base" +DEPENDS = "ncurses virtual/libintl" +LICENSE = "GPLv2" + +inherit autotools gettext + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" +PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," + +ALLOW_EMPTY_${PN} = "1" + +PACKAGES =+ "fuser fuser-doc killall killall-doc pstree pstree-doc" +PACKAGES += "psmisc-extras" + +FILES_${PN} = "" +RDEPENDS_${PN} = "fuser killall pstree" + +FILES_fuser = "${bindir}/fuser.${BPN}" +FILES_fuser-doc = "${mandir}/man1/fuser*" + +FILES_killall = "${bindir}/killall.${BPN}" +FILES_killall-doc = "${mandir}/man1/killall*" + +FILES_pstree = "${bindir}/pstree" +FILES_pstree-doc = "${mandir}/man1/pstree*" + +FILES_psmisc-extras = "${bindir}" +FILES_psmisc-extras-doc = "${mandir}" diff --git a/meta-openeuler/recipes-core/psmisc/psmisc_23.4.bb b/meta-openeuler/recipes-core/psmisc/psmisc_23.4.bb new file mode 100644 index 0000000000000000000000000000000000000000..77389ea510b848616ef658051e0e0d087d159801 --- /dev/null +++ b/meta-openeuler/recipes-core/psmisc/psmisc_23.4.bb @@ -0,0 +1,6 @@ +require psmisc.inc +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" + +SRC_URI = "file://psmisc/${BP}.tar.xz" +S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/recipes-devtools/binutils/binutils-2.37.inc b/meta-openeuler/recipes-devtools/binutils/binutils-2.37.inc new file mode 100644 index 0000000000000000000000000000000000000000..85b7ef21575dab932c8c92d976849e2de10c1d71 --- /dev/null +++ b/meta-openeuler/recipes-devtools/binutils/binutils-2.37.inc @@ -0,0 +1,33 @@ +LIC_FILES_CHKSUM="\ + file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ + file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\ + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\ + file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\ + file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\ + file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ + file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\ + file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\ + file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\ + " + +def binutils_branch_version(d): + pvsplit = d.getVar('PV').split('.') + return pvsplit[0] + "_" + pvsplit[1] + +# When upgrading to 2.37, please make sure there is no trailing .0, so +# that upstream version check can work correctly. +PV = "2.37" +CVE_VERSION = "2.37" + +SRC_URI = "file://binutils/${BP}.tar.xz \ + file://binutils/backport-CVE-2021-45078.patch \ + file://binutils/binutils-2.20.51.0.2-libtool-lib64.patch \ + file://binutils/binutils-2.22.52.0.4-no-config-h-check.patch \ + file://binutils/CVE-2019-1010204.patch \ + file://binutils/binutils-2.27-aarch64-ifunc.patch \ + file://binutils/export-demangle.h-in-devel-package.patch \ + file://binutils/Fix-a-potential-use-of-an-uninitialised-value-in-the.patch \ + file://0005-Point-scripts-location-to-libdir.patch \ +" + +S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/recipes-devtools/binutils/binutils.inc b/meta-openeuler/recipes-devtools/binutils/binutils.inc new file mode 100644 index 0000000000000000000000000000000000000000..5bd1650c5b2cca6763ba9ae8e46fa410fa9d0723 --- /dev/null +++ b/meta-openeuler/recipes-devtools/binutils/binutils.inc @@ -0,0 +1,186 @@ +SUMMARY = "GNU binary utilities" +DESCRIPTION = "The GNU Binutils are a collection of binary tools. \ +The main ones are ld (GNU Linker), and as (GNU Assembler). This \ +package also includes addition tools such as addr2line (Converts \ +addresses into filenames and line numbers), ar (utility for creating, \ +modifying and extracting archives), nm (list symbols in object \ +files), objcopy (copy and translate object files), objdump (Display \ +object information), and other tools and related libraries." +HOMEPAGE = "http://www.gnu.org/software/binutils/" +BUGTRACKER = "http://sourceware.org/bugzilla/" +SECTION = "devel" +LICENSE = "GPLv3" + +DEPENDS = "gnu-config-native autoconf-native" + +inherit autotools gettext multilib_header texinfo + +FILES_${PN} = " \ + ${bindir}/${TARGET_PREFIX}* \ + ${libdir}/lib*.so.* \ + ${libdir}/bfd-plugins/lib*.so \ + ${libdir}/lib*-${PV}*.so \ + ${prefix}/${TARGET_SYS}/bin/* \ + ${bindir}/embedspu" + +RPROVIDES_${PN} += "${PN}-symlinks" + +FILES_${PN}-dev = " \ + ${includedir} \ + ${libdir}/*.la \ + ${libdir}/libbfd.so \ + ${libdir}/libctf.so \ + ${libdir}/libctf-nobfd.so \ + ${libdir}/libopcodes.so" + +# Rather than duplicating multiple entries for these, make one +# list and reuse it. + +LDGOLD_ALTS ?= "ld.gold dwp" +LDGOLD_ALTS_riscv64 = "" +LDGOLD_ALTS_riscv32 = "" +LDGOLD_ALTS_libc-glibc_mipsarch = "" + +USE_ALTERNATIVES_FOR = " \ + addr2line \ + ar \ + as \ + c++filt \ + elfedit \ + gprof \ + ld \ + ld.bfd \ + ${LDGOLD_ALTS} \ + nm \ + objcopy \ + objdump \ + ranlib \ + readelf \ + size \ + strings \ + strip \ +" + +python do_package_prepend() { + make_alts = d.getVar("USE_ALTERNATIVES_FOR") or "" + prefix = d.getVar("TARGET_PREFIX") + bindir = d.getVar("bindir") + for alt in make_alts.split(): + d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt) + d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt) +} + +B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" + +EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \ + --disable-werror \ + --enable-deterministic-archives \ + --enable-plugins \ + --disable-gdb \ + --disable-gdbserver \ + --disable-libdecnumber \ + --disable-readline \ + --disable-sim \ + ${LDGOLD} \ + ${EXTRA_TARGETS} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}" + +EXTRA_TARGETS = "" +EXTRA_TARGETS_x86-64 = " --enable-targets=x86_64-pe,x86_64-pep " +EXTRA_TARGETS_class-native = "" + +LDGOLD_class-native = "" +LDGOLD_class-crosssdk = "" +LDGOLD_libc-glibc_mipsarch = "" +LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default --enable-threads', d)}" + + +# This is necessary due to a bug in the binutils Makefiles +# EXTRA_OEMAKE = "configure-build-libiberty all" + +export AR = "${HOST_PREFIX}ar" +export AS = "${HOST_PREFIX}as" +export LD = "${HOST_PREFIX}ld" +export NM = "${HOST_PREFIX}nm" +export RANLIB = "${HOST_PREFIX}ranlib" +export OBJCOPY = "${HOST_PREFIX}objcopy" +export OBJDUMP = "${HOST_PREFIX}objdump" + +export AR_FOR_TARGET = "${TARGET_PREFIX}ar" +export AS_FOR_TARGET = "${TARGET_PREFIX}as" +export LD_FOR_TARGET = "${TARGET_PREFIX}ld" +export NM_FOR_TARGET = "${TARGET_PREFIX}nm" +export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib" + +export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}" +export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}" + +# autotools.bbclass sets the _FOR_BUILD variables, but for some reason we need +# to unset LD_LIBRARY_PATH. +export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}" + +MULTIARCH := "${@bb.utils.contains("DISTRO_FEATURES", "multiarch", "yes", "no", d)}" +do_configure[vardeps] += "MULTIARCH" +do_configure () { + (cd ${S} && gnu-configize) + + oe_runconf +# +# must prime config.cache to ensure the build of libiberty +# + mkdir -p ${B}/build-${BUILD_SYS} + for i in ${CONFIG_SITE}; do + cat $i >> ${B}/build-${BUILD_SYS}/config.cache || true + done +} + +do_install () { + autotools_do_install + + # We don't really need these, so we'll remove them... + rm -rf ${D}${libdir}/ldscripts + + bindir_rel=${@os.path.relpath('${bindir}', '${prefix}/${TARGET_SYS}/bin')} + + # Fix the /usr/${TARGET_SYS}/bin/* links + for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do + rm -f $l + ln -sf $bindir_rel/${TARGET_PREFIX}`basename $l` $l + done + + # Install the libiberty header + install -d ${D}${includedir} + install -m 644 ${S}/include/ansidecl.h ${D}${includedir} + install -m 644 ${S}/include/libiberty.h ${D}${includedir} + + # insall pic version of libiberty if available + if [ -e ${B}/libiberty/pic/libiberty.a ]; then + install -Dm 0644 ${B}/libiberty/pic/libiberty.a ${D}${libdir}/libiberty.a + fi + + cd ${D}${bindir} + + # Symlinks for ease of running these on the native target + for p in ${TARGET_PREFIX}* ; do + ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,` + done + + for alt in ${USE_ALTERNATIVES_FOR}; do + rm -f ${D}${bindir}/$alt + done + + oe_multilib_header bfd.h + # bfd_stdint.h encodes the compiler name in the header + # sed -i ${D}${includedir}/bfd_stdint.h -e "s,${TARGET_PREFIX},," +} + +#inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_${PN}_class-target = "${USE_ALTERNATIVES_FOR}" + +python () { + if bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', True, False, d) and bb.utils.contains_any('TARGET_ARCH', 'riscv32 riscv64', True, False, d): + bb.fatal("Gold linker does not _yet_ support RISC-V architecture please remove ld-is-gold from DISTRO_FEATURES") +} diff --git a/meta-openeuler/recipes-devtools/binutils/binutils/0005-Point-scripts-location-to-libdir.patch b/meta-openeuler/recipes-devtools/binutils/binutils/0005-Point-scripts-location-to-libdir.patch new file mode 100644 index 0000000000000000000000000000000000000000..dde0cb5d6d0c683269ba5c267a8fdcee4f2294ff --- /dev/null +++ b/meta-openeuler/recipes-devtools/binutils/binutils/0005-Point-scripts-location-to-libdir.patch @@ -0,0 +1,39 @@ +From 6a67d277941228d997b527990960413f8444fb81 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 2 Mar 2015 01:09:58 +0000 +Subject: [PATCH] Point scripts location to libdir + +Upstream-Status: Inappropriate [debian patch] + +Signed-off-by: Khem Raj +--- + ld/Makefile.am | 2 +- + ld/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ld/Makefile.am b/ld/Makefile.am +index 3b01357b651..b7a1f7491b0 100644 +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -51,7 +51,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + + EMUL = @EMUL@ + EMULATION_OFILES = @EMULATION_OFILES@ +diff --git a/ld/Makefile.in b/ld/Makefile.in +index a6382bf2a45..5ee3a4971be 100644 +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -562,7 +562,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + BASEDIR = $(srcdir)/.. + BFDDIR = $(BASEDIR)/bfd + INCDIR = $(BASEDIR)/include diff --git a/meta-openeuler/recipes-devtools/binutils/binutils_2.37.bb b/meta-openeuler/recipes-devtools/binutils/binutils_2.37.bb new file mode 100644 index 0000000000000000000000000000000000000000..e01dd4254417ae627365c1c23a1cbe85af514fcc --- /dev/null +++ b/meta-openeuler/recipes-devtools/binutils/binutils_2.37.bb @@ -0,0 +1,65 @@ +require binutils.inc +require binutils-${PV}.inc + +DEPENDS += "zlib" +EXTRA_OECONF += "--with-sysroot=/ \ + --enable-install-libbfd \ + --enable-install-libiberty \ + --enable-shared \ + --with-system-zlib \ + " + +EXTRA_OEMAKE_append_libc-musl = "\ + gt_cv_func_gnugettext1_libc=yes \ + gt_cv_func_gnugettext2_libc=yes \ + " +EXTRA_OECONF_class-native = "--enable-targets=all \ + --enable-64-bit-bfd \ + --enable-install-libiberty \ + --enable-install-libbfd \ + --disable-gdb \ + --disable-gdbserver \ + --disable-libdecnumber \ + --disable-readline \ + --disable-sim \ + --disable-werror" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, elfutils" +# gcc9.0 end up mis-compiling libbfd.so with O2 which then crashes on target +# So remove -O2 and use -Os as workaround +SELECTED_OPTIMIZATION_remove_mipsarch = "-O2" +SELECTED_OPTIMIZATION_append_mipsarch = " -Os" + +do_install_class-native () { + autotools_do_install + + # Install the libiberty header + install -d ${D}${includedir} + install -m 644 ${S}/include/ansidecl.h ${D}${includedir} + install -m 644 ${S}/include/libiberty.h ${D}${includedir} + + # We only want libiberty, libbfd and libopcodes + rm -rf ${D}${bindir} + rm -rf ${D}${prefix}/${TARGET_SYS} + rm -rf ${D}${prefix}/lib/ldscripts + rm -rf ${D}${prefix}/share/info + rm -rf ${D}${prefix}/share/locale + rm -rf ${D}${prefix}/share/man + rmdir ${D}${prefix}/share || : + rmdir ${D}/${libdir}/gcc-lib || : + rmdir ${D}/${libdir}64/gcc-lib || : + rmdir ${D}/${libdir} || : + rmdir ${D}/${libdir}64 || : +} + +# libctf races with libbfd +PARALLEL_MAKEINST_class-target = "" + +# Split out libbfd-*.so and libopcodes-*.so so including perf doesn't include +# extra stuff +PACKAGE_BEFORE_PN += "libbfd libopcodes" +FILES_libbfd = "${libdir}/libbfd-*.so.* ${libdir}/libbfd-*.so" +FILES_libopcodes = "${libdir}/libopcodes-*.so.* ${libdir}/libopcodes-*.so" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-devtools/elfutils/elfutils_0.185.bb b/meta-openeuler/recipes-devtools/elfutils/elfutils_0.185.bb new file mode 100644 index 0000000000000000000000000000000000000000..d320650a2ab996e31325aa28246e1e13c19477f7 --- /dev/null +++ b/meta-openeuler/recipes-devtools/elfutils/elfutils_0.185.bb @@ -0,0 +1,147 @@ +SUMMARY = "Utilities and libraries for handling compiled object files" +HOMEPAGE = "https://sourceware.org/elfutils" +DESCRIPTION = "elfutils is a collection of utilities and libraries to read, create and modify ELF binary files, find and handle DWARF debug data, symbols, thread state and stacktraces for processes and core files on GNU/Linux." +SECTION = "base" +LICENSE = "GPLv2 & GPLv2+ & LGPLv3+ & GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://debuginfod/debuginfod-client.c;endline=27;md5=f8e9d171c401c493ec45a0b2992ea2ed \ + " +DEPENDS = "zlib virtual/libintl" +DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack " +# The Debian patches below are from: +# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz +SRC_URI = "file://elfutils/${BP}.tar.bz2 \ + file://run-ptest \ +" + +SRC_URI[sha256sum] = "dc8d3e74ab209465e7f568e1b3bb9a5a142f8656e2b57d10049a73da2ae6b5a6" + +inherit autotools gettext ptest pkgconfig + +EXTRA_OECONF = "--program-prefix=eu-" + +DEPENDS_BZIP2 = "bzip2-replacement-native" +DEPENDS_BZIP2_class-target = "bzip2" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}" +PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz" +PACKAGECONFIG[libdebuginfod] = "--enable-libdebuginfod,--disable-libdebuginfod,curl" +PACKAGECONFIG[debuginfod] = "--enable-debuginfod,--disable-debuginfod,libarchive sqlite3 libmicrohttpd" + +RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils" + +EXTRA_OECONF_append_class-target = " --disable-tests-rpath" + +RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" + +do_compile_ptest() { + cd ${B}/tests + oe_runmake buildtest-TESTS oecheck +} + +do_install_ptest() { + if [ ${PTEST_ENABLED} = "1" ]; then + # copy the files which needed by the cases + TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip" + install -d -m 755 ${D}${PTEST_PATH}/src + install -d -m 755 ${D}${PTEST_PATH}/libelf + install -d -m 755 ${D}${PTEST_PATH}/libdw + install -d -m 755 ${D}${PTEST_PATH}/libdwfl + install -d -m 755 ${D}${PTEST_PATH}/libdwelf + install -d -m 755 ${D}${PTEST_PATH}/libasm + install -d -m 755 ${D}${PTEST_PATH}/libcpu + install -d -m 755 ${D}${PTEST_PATH}/libebl + for test_file in ${TEST_FILES}; do + if [ -f ${B}/src/${test_file} ]; then + cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src + fi + done + cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so + cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so + cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so + cp ${B}/libcpu/libcpu.a ${D}${PTEST_PATH}/libcpu/ + cp ${B}/libebl/libebl.a ${D}${PTEST_PATH}/libebl/ + cp ${S}/libelf/*.h ${D}${PTEST_PATH}/libelf/ + cp ${S}/libdw/*.h ${D}${PTEST_PATH}/libdw/ + cp ${S}/libdwfl/*.h ${D}${PTEST_PATH}/libdwfl/ + cp ${S}/libdwelf/*.h ${D}${PTEST_PATH}/libdwelf/ + cp ${S}/libasm/*.h ${D}${PTEST_PATH}/libasm/ + cp -r ${S}/tests/ ${D}${PTEST_PATH} + cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests + cp -r ${B}/config.h ${D}${PTEST_PATH} + cp -r ${B}/backends ${D}${PTEST_PATH} + sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile + find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {} + fi +} + +EXTRA_OEMAKE_class-native = "" +EXTRA_OEMAKE_class-nativesdk = "" + +BBCLASSEXTEND = "native nativesdk" + +# Package utilities separately +PACKAGES =+ "${PN}-binutils libelf libasm libdw libdebuginfod" + +# shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+ +# according to NEWS file: +# "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone +# programs. There is now also a formal CONTRIBUTING document describing how to +# submit patches." +LICENSE_${PN}-binutils = "GPLv3+" +LICENSE_${PN} = "GPLv3+" +LICENSE_libelf = "GPLv2 | LGPLv3+" +LICENSE_libasm = "GPLv2 | LGPLv3+" +LICENSE_libdw = "GPLv2 | LGPLv3+" +LICENSE_libdebuginfod = "GPLv2+ | LGPLv3+" + +FILES_${PN}-binutils = "\ + ${bindir}/eu-addr2line \ + ${bindir}/eu-ld \ + ${bindir}/eu-nm \ + ${bindir}/eu-readelf \ + ${bindir}/eu-size \ + ${bindir}/eu-strip" + +FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*" +FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*" +FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*" +FILES_libdebuginfod = "${libdir}/libdebuginfod-${PV}.so ${libdir}/libdebuginfod.so.*" +# Some packages have the version preceeding the .so instead properly +# versioned .so., so we need to reorder and repackage. +#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so" +#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so" + +# The package contains symlinks that trip up insane +INSANE_SKIP_${MLPREFIX}libdw = "dev-so" +# The nlist binary in the tests uses explicitly minimal compiler flags +INSANE_SKIP_${PN}-ptest += "ldflags" + +# avoid stripping some generated binaries otherwise some of the tests such as test-nlist, +# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail +INHIBIT_PACKAGE_STRIP_FILES = "\ + ${PKGD}${PTEST_PATH}/tests/test-nlist \ + ${PKGD}${PTEST_PATH}/tests/elfstrmerge \ + ${PKGD}${PTEST_PATH}/tests/backtrace-child \ + ${PKGD}${PTEST_PATH}/tests/backtrace-data \ + ${PKGD}${PTEST_PATH}/tests/backtrace-dwarf \ + ${PKGD}${PTEST_PATH}/tests/deleted \ + ${PKGD}${PTEST_PATH}/src/strip \ + ${PKGD}${PTEST_PATH}/src/addr2line \ + ${PKGD}${PTEST_PATH}/src/elfcmp \ + ${PKGD}${PTEST_PATH}/src/objdump \ + ${PKGD}${PTEST_PATH}/src/readelf \ + ${PKGD}${PTEST_PATH}/src/nm \ + ${PKGD}${PTEST_PATH}/src/elflint \ + ${PKGD}${PTEST_PATH}/src/elfclassify \ + ${PKGD}${PTEST_PATH}/src/stack \ + ${PKGD}${PTEST_PATH}/src/unstrip \ + ${PKGD}${PTEST_PATH}/libelf/libelf.so \ + ${PKGD}${PTEST_PATH}/libdw/libdw.so \ + ${PKGD}${PTEST_PATH}/libasm/libasm.so \ + ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \ + ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \ +" + +PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1" diff --git a/meta-openeuler/recipes-devtools/elfutils/files/run-ptest b/meta-openeuler/recipes-devtools/elfutils/files/run-ptest new file mode 100644 index 0000000000000000000000000000000000000000..d5776fdb5386698990c2a143dda8ed63334109d5 --- /dev/null +++ b/meta-openeuler/recipes-devtools/elfutils/files/run-ptest @@ -0,0 +1,6 @@ +#!/bin/sh +# +#This script is used to run elfutils test suites +cd tests + +make -k installcheck-local CC=gcc abs_srcdir=$PWD abs_builddir=$PWD srcdir=$PWD top_srcdir=$PWD/../ abs_top_builddir=$PWD/../ elfutils_testrun=installed elfutils_tests_rpath=no program_transform_name=s,^,eu-, diff --git a/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_4.5.bb b/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_4.5.bb new file mode 100644 index 0000000000000000000000000000000000000000..53a1060e17bb3638690c04fcd539dae8ce5e88cc --- /dev/null +++ b/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_4.5.bb @@ -0,0 +1,42 @@ +# Note, we can probably remove the lzma option as it has be replaced with xz, +# and I don't think the kernel supports it any more. +SUMMARY = "Tools for manipulating SquashFS filesystems" +HOMEPAGE = "https://github.com/plougher/squashfs-tools" +DESCRIPTION = "Tools to create and extract Squashfs filesystems." +SECTION = "base" +LICENSE = "GPL-2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +SRC_URI = "file://squashfs-tools/squashfs4.5.tar.gz \ + file://squashfs-tools/0001-CVE-2021-41072.patch \ + file://squashfs-tools/0002-CVE-2021-41072.patch \ + file://squashfs-tools/0003-CVE-2021-41072.patch \ + file://squashfs-tools/0004-CVE-2021-41072.patch \ + file://squashfs-tools/0005-CVE-2021-41072.patch \ +" + +S = "${WORKDIR}/${BP}" +B = "${S}/${PN}" + +EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS}" + +PACKAGECONFIG ??= "gzip xz xattr" +PACKAGECONFIG[gzip] = "GZIP_SUPPORT=1,GZIP_SUPPORT=0,zlib" +PACKAGECONFIG[xz] = "XZ_SUPPORT=1,XZ_SUPPORT=0,xz" +PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr" + +do_compile() { + oe_runmake all +} + +do_install() { + oe_runmake install INSTALL_DIR=${D}${sbindir} +} + +ARM_INSTRUCTION_SET_armv4 = "arm" +ARM_INSTRUCTION_SET_armv5 = "arm" +ARM_INSTRUCTION_SET_armv6 = "arm" + +BBCLASSEXTEND = "native nativesdk" + +CVE_PRODUCT = "squashfs" diff --git a/meta-openeuler/recipes-devtools/strace/strace/run-ptest b/meta-openeuler/recipes-devtools/strace/strace/run-ptest new file mode 100755 index 0000000000000000000000000000000000000000..3a51fb0be9d8b844cd4b285d8da4ac0da4aa53a4 --- /dev/null +++ b/meta-openeuler/recipes-devtools/strace/strace/run-ptest @@ -0,0 +1,6 @@ +#!/bin/sh +export TIMEOUT_DURATION=240 +chown nobody tests +chown nobody tests/* +chown nobody ../ptest +su nobody -c "make -B -C tests -k test-suite.log" diff --git a/meta-openeuler/recipes-devtools/strace/strace_5.14.bb b/meta-openeuler/recipes-devtools/strace/strace_5.14.bb new file mode 100644 index 0000000000000000000000000000000000000000..7125c0ef9e100afe1523cf7663fdb08e0b813c73 --- /dev/null +++ b/meta-openeuler/recipes-devtools/strace/strace_5.14.bb @@ -0,0 +1,49 @@ +SUMMARY = "System call tracing tool" +HOMEPAGE = "http://strace.io" +DESCRIPTION = "strace is a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state." +SECTION = "console/utils" +LICENSE = "LGPL-2.1+ & GPL-2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=318cfc887fc8723f4e9d4709b55e065b" + +SRC_URI = "file://strace/strace-${PV}.tar.xz \ + file://run-ptest \ + " +SRC_URI[sha256sum] = "901bee6db5e17debad4530dd9ffb4dc9a96c4a656edbe1c3141b7cb307b11e73" + +inherit autotools ptest + +#PACKAGECONFIG_class-target ??= "\ +# ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ +#" + +#PACKAGECONFIG[bluez] = "ac_cv_header_bluetooth_bluetooth_h=yes,ac_cv_header_bluetooth_bluetooth_h=no,bluez5" +PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind" + +EXTRA_OECONF += "--enable-mpers=no --disable-gcc-Werror" + +CFLAGS_append_libc-musl = " -Dsigcontext_struct=sigcontext" + +TESTDIR = "tests" +PTEST_BUILD_HOST_PATTERN = "^(DEB_CHANGELOGTIME|RPM_CHANGELOGTIME|WARN_CFLAGS_FOR_BUILD|LDFLAGS_FOR_BUILD)" + +do_compile_ptest() { + oe_runmake ${PARALLEL_MAKE} -C ${TESTDIR} buildtest-TESTS +} + +do_install_ptest() { + oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR} + mkdir -p ${D}${PTEST_PATH}/build-aux + mkdir -p ${D}${PTEST_PATH}/src + install -m 755 ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ + install -m 644 ${B}/src/config.h ${D}${PTEST_PATH}/src/ + sed -i -e '/^src/s/strace.*[0-9]/ptest/' ${D}/${PTEST_PATH}/${TESTDIR}/Makefile +} + +RDEPENDS_${PN}-ptest += "make coreutils grep gawk sed" + +RDEPENDS_${PN}-ptest_append_libc-glibc = "\ + locale-base-en-us.iso-8859-1 \ +" + +BBCLASSEXTEND = "native" +TOOLCHAIN = "gcc" diff --git a/meta-openeuler/recipes-kernel/kexec/kexec-tools/kdump b/meta-openeuler/recipes-kernel/kexec/kexec-tools/kdump new file mode 100755 index 0000000000000000000000000000000000000000..69e3cafe5cfa7a37b5964d9dcdf67b9525fbf65d --- /dev/null +++ b/meta-openeuler/recipes-kernel/kexec/kexec-tools/kdump @@ -0,0 +1,145 @@ +#! /bin/sh +# +# kdump +# +# Description: The kdump script provides the support: +# 1. Load a kdump kernel image into memory; +# 2. Copy away vmcore when system panic. +# + +#default +KEXEC=/usr/sbin/kexec +KEXEC_ARGS="-p" + +MAKEDUMPFILE=/usr/bin/makedumpfile +MAKEDUMPFILE_ARGS="-E -d 1" + +LOGGER="logger -p info -t kdump" + +if [ -f /etc/sysconfig/kdump.conf ]; then + . /etc/sysconfig/kdump.conf +else + echo "no /etc/sysconfig/kdump.conf" + exit 1; +fi + +do_check() +{ + #check makedumpfile + if [ ! -e ${MAKEDUMPFILE} -o ! -x ${MAKEDUMPFILE} ] ;then + echo "No makedumpfile found." + exit 0 + fi + + #check kexec + if [ ! -e ${KEXEC} -o ! -x ${KEXEC} ] ;then + echo "No kexec found." + exit 0 + fi + + #check whether kdump kernel image exists on the system + if [ -z "${KDUMP_KIMAGE}" -o ! -f "${KDUMP_KIMAGE}" ]; then + echo "No kdump kernel image found." + exit 0 + fi + + if [ "${KDUMP_CMDLINE}"x = "x" ] ; then + echo "KDUMP_CMDLINE is not configured" + exit 0 + fi +} + +do_save_vmcore() +{ + if [ ${KDUMP_VMCORE_PATH}x = x ]; then + KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`" + fi + + mkdir -p ${KDUMP_VMCORE_PATH} + echo "Saving a vmcore to ${KDUMP_VMCORE_PATH}." + + ${MAKEDUMPFILE} ${MAKEDUMPFILE_ARGS} /proc/vmcore ${KDUMP_VMCORE_PATH}/vmcore-"`date +"%H:%M:%S"`" +# cp --sparse=always /proc/vmcore ${KDUMP_VMCORE_PATH}/vmcore-"`date +"%H:%M:%S"`" + rc=$? + if [ ${rc} == 0 ]; then + ${LOGGER} "Saved a vmcore to ${KDUMP_VMCORE_PATH}." + else + ${LOGGER} "Failed to save vmcore!" + fi + return ${rc} +} + +do_start() +{ + #check file + do_check + + #check whether the running kernel supports kdump. + if [ ! -e /sys/kernel/kexec_crash_loaded ]; then + echo "Kdump isn't supported on the running kernel!!!" + ${LOGGER} "Kdump isn't supported on the running kernel!!!" + return 1 + fi + + #check whether kdump kernel image has been loaded + rc=`cat /sys/kernel/kexec_crash_loaded` + if [ ${rc} != 0 ]; then + echo "Kdump is already running."; + ${LOGGER} "Kdump is already running." + return 0 + fi + + #check the running kernel cmdline option,insure "crashkernel=" always set. + grep -q crashkernel= /proc/cmdline + if [ $? != 0 ]; then + echo "Kdump isn't supported on the running kernel,please check boot option!!!" + ${LOGGER} "Kdump isn't supported on the running kernel,please check boot option!!!" + return 1 + fi + + #Load the kdump kernel image + ${KEXEC} ${KEXEC_ARGS} "${KDUMP_KIMAGE}" --append="${KDUMP_CMDLINE}" + if [ $? != 0 ]; then + echo "Failed to load kdump kernel!" + ${LOGGER} "Failed to load kdump kernel!" + return 1 + fi + + echo "Kdump started up." + ${LOGGER} "Kdump started up." +} + +do_stop() +{ + ${KEXEC} -p -u 2>/dev/null + if [ $? == 0 ]; then + echo "Kdump has been stopped." + ${LOGGER} "Kdump has been stopped." + else + echo "Failed to stop kdump!" + ${LOGGER} "Failed to stop kdump!" + fi +} + +case "$1" in + start) + if [ -s /proc/vmcore ]; then + do_save_vmcore + reboot + else + do_start + fi + ;; + restart) + do_stop + do_start + ;; + stop) + do_stop + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? diff --git a/meta-openeuler/recipes-kernel/kexec/kexec-tools/kdump.conf b/meta-openeuler/recipes-kernel/kexec/kexec-tools/kdump.conf new file mode 100644 index 0000000000000000000000000000000000000000..38190d207a1b4b478c6b37e2fedaed395af72ce7 --- /dev/null +++ b/meta-openeuler/recipes-kernel/kexec/kexec-tools/kdump.conf @@ -0,0 +1,14 @@ +#the kdump kernel version string. +#KDUMP_KVER="`uname -r`" + +#this will be passed to the kdump kernel as kdump kernel command line +#KDUMP_CMDLINE="`cat /proc/cmdline`" + +#the kernel image for kdump +#KDUMP_KIMAGE="/boot/bzImage-${KDUMP_KVER}" + +#Where to save the vmcore +#KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`" + +#the arguments to makedumpfile +MAKEDUMPFILE_ARGS="--dump-dmesg -x /boot/vmlinux-`uname -r`" diff --git a/meta-openeuler/recipes-kernel/kexec/kexec-tools/kdump.service b/meta-openeuler/recipes-kernel/kexec/kexec-tools/kdump.service new file mode 100644 index 0000000000000000000000000000000000000000..b4a2c0611d30173c593ae277c0b63fda793022c3 --- /dev/null +++ b/meta-openeuler/recipes-kernel/kexec/kexec-tools/kdump.service @@ -0,0 +1,14 @@ +[Unit] +Description=Reboot and dump vmcore via kexec +DefaultDependencies=no +Requires=sysinit.target +After=sysinit.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=@LIBEXECDIR@/kdump-helper start +ExecStop=@LIBEXECDIR@/kdump-helper stop + +[Install] +WantedBy=multi-user.target diff --git a/meta-openeuler/recipes-kernel/kexec/kexec-tools_2.0.20.bb b/meta-openeuler/recipes-kernel/kexec/kexec-tools_2.0.20.bb new file mode 100644 index 0000000000000000000000000000000000000000..e8cc09d3cc794a49db2ca015256aada0ef0453a7 --- /dev/null +++ b/meta-openeuler/recipes-kernel/kexec/kexec-tools_2.0.20.bb @@ -0,0 +1,106 @@ +SUMMARY = "Kexec fast reboot tools" +DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel" +AUTHOR = "Eric Biederman" +HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/" +SECTION = "kernel/userland" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \ + file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09" +DEPENDS = "zlib" + +SRC_URI = "file://kexec-tools/kexec-tools-${PV}.tar.xz \ + file://kexec-tools/kexec-tools-2.0.20-fix-broken-multiboot2-buliding-for-i386.patch \ + file://kexec-tools/kexec-tools-2.0.20-Remove-duplicated-variable-declarations.patch \ + file://kexec-tools/kexec-add-variant-helper-functions-for-handling-memory-regions.patch \ + file://kexec-tools/arm64-kexec-allocate-memory-space-avoiding-reserved-regions.patch \ + file://kexec-tools/x86-Fix-PAGE_OFFSET-for-kernels-since-4.20.patch \ + file://kexec-tools/Cleanup-remove-the-read_elf_kcore.patch \ + file://kexec-tools/Fix-an-error-definition-about-the-variable-fname.patch \ + file://kexec-tools/Cleanup-move-it-back-from-util_lib-elf_info.c.patch \ + file://kexec-tools/Limit-the-size-of-vmcore-dmesg.txt-to-2G.patch \ + file://kexec-tools/vmcore-dmesg-vmcore-dmesg.c-Fix-shifting-error-reported-by-cppcheck.patch \ + file://kexec-tools/kexec-tools-Fix-possible-out-of-bounds-access-in-ifdown.patch \ + file://kexec-tools/kexec-tools-Fix-kexec_file_load-2-error-handling.patch \ + file://kexec-tools/kexec-tools-Reset-getopt-before-falling-back-to-legacy.patch \ + file://kexec-tools/kexec-support-parsing-the-string-Reserved-to-get-the-correct-e820-reserved-region.patch \ + file://kexec-tools/arm64-kdump-deal-with-a-lot-of-resource-entries-in-proc-iomem.patch \ +" +SRC_URI_append_aarch64 += " \ + file://kexec-tools/arm64-support-more-than-one-crash-kernel-regions.patch \ +" +SRC_URI_append += " \ + file://kexec-tools/kexec-Add-quick-kexec-support.patch \ +" +SRC_URI_append_aarch64 += " \ + file://kexec-tools/kexec-Quick-kexec-implementation-for-arm64.patch \ +" +SRC_URI_append += " \ + file://kexec-tools/backport-print-add-support-for-lockless-ringbuffer.patch \ + file://kdump \ + file://kdump.conf \ + file://kdump.service \ +" +SRC_URI[sha256sum] = "dad8077f0315445d1f6335579fc4ade222facf82a67124974c7be5303ba4f8c8" + +inherit autotools + +export LDFLAGS = "-L${STAGING_LIBDIR}" +EXTRA_OECONF = " --with-zlib=yes" + +do_compile_prepend() { + # Remove the prepackaged config.h from the source tree as it overrides + # the same file generated by configure and placed in the build tree + rm -f ${S}/include/config.h + + # Remove the '*.d' file to make sure the recompile is OK + for dep in `find ${B} -type f -name '*.d'`; do + dep_no_d="`echo $dep | sed 's#.d$##'`" + # Remove file.d when there is a file.o + if [ -f "$dep_no_d.o" ]; then + rm -f $dep + fi + done +} + +do_install_append () { + install -d ${D}${sysconfdir}/sysconfig + install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig + + if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -D -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump + fi + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -D -m 0755 ${WORKDIR}/kdump ${D}${libexecdir}/kdump-helper + install -D -m 0644 ${WORKDIR}/kdump.service ${D}${systemd_unitdir}/system/kdump.service + sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_unitdir}/system/kdump.service + fi +} + +PACKAGES =+ "kexec kdump vmcore-dmesg" + +ALLOW_EMPTY_${PN} = "1" +RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg" + +FILES_kexec = "${sbindir}/kexec" +FILES_kdump = "${sbindir}/kdump \ + ${sysconfdir}/sysconfig/kdump.conf \ + ${sysconfdir}/init.d/kdump \ + ${libexecdir}/kdump-helper \ + ${systemd_unitdir}/system/kdump.service \ +" + +FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg" + +INITSCRIPT_PACKAGES = "kdump" +INITSCRIPT_NAME_kdump = "kdump" +INITSCRIPT_PARAMS_kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ." + +SYSTEMD_PACKAGES = "kdump" +SYSTEMD_SERVICE_kdump = "kdump.service" + +SECURITY_PIE_CFLAGS_remove = "-fPIE -pie" + +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)' + +INSANE_SKIP_${PN} = "arch"