From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B2242138335 for ; Sun, 14 Jul 2019 13:00:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 81417E08DA; Sun, 14 Jul 2019 13:00:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4D000E08DA for ; Sun, 14 Jul 2019 13:00:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BF47D347AAC for ; Sun, 14 Jul 2019 13:00:35 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E59D173B for ; Sun, 14 Jul 2019 13:00:30 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1563105498.8ef7e7ec94162d39dfdc71da20b9532db6cfab2b.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/, gkbuilds/, / X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/software.sh gen_cmdline.sh gen_determineargs.sh gen_initramfs.sh gkbuilds/strace.gkbuild X-VCS-Directories: / gkbuilds/ defaults/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 8ef7e7ec94162d39dfdc71da20b9532db6cfab2b X-VCS-Branch: master Date: Sun, 14 Jul 2019 13:00:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8606334b-ccad-4fb2-8c80-71f0cb5ce291 X-Archives-Hash: b7bc894138d083a1a7a044c2e4ca2f3a commit: 8ef7e7ec94162d39dfdc71da20b9532db6cfab2b Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 14 10:43:27 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Jul 14 11:58:18 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=8ef7e7ec Add --strace support For debugging purpose. Signed-off-by: Thomas Deutschmann gentoo.org> defaults/software.sh | 7 +++++++ gen_cmdline.sh | 4 ++++ gen_determineargs.sh | 1 + gen_initramfs.sh | 21 +++++++++++++++++++++ gkbuilds/strace.gkbuild | 25 +++++++++++++++++++++++++ 5 files changed, 58 insertions(+) diff --git a/defaults/software.sh b/defaults/software.sh index 34b38dc..ec4dc78 100644 --- a/defaults/software.sh +++ b/defaults/software.sh @@ -142,6 +142,13 @@ GKPKG_POPT_SRCDIR="${GKPKG_POPT_SRCDIR:-popt-${GKPKG_POPT_PV}}" GKPKG_POPT_SRCTAR="${GKPKG_POPT_SRCTAR:-${DISTDIR}/popt-${GKPKG_POPT_PV}.tar.gz}" GKPKG_POPT_BINPKG="${GKPKG_POPT_BINPKG:-%%CACHE%%/popt-${GKPKG_POPT_PV}-%%ARCH%%.tar.xz}" +GKPKG_STRACE_PN="strace" +GKPKG_STRACE_PV="${GKPKG_STRACE_PV:-VERSION_STRACE}" +GKPKG_STRACE_DEPS="" +GKPKG_STRACE_SRCTAR="${GKPKG_STRACE_SRCTAR:-${DISTDIR}/strace-${GKPKG_STRACE_PV}.tar.xz}" +GKPKG_STRACE_SRCDIR="${GKPKG_STRACE_SRCDIR:-strace-${GKPKG_STRACE_PV}}" +GKPKG_STRACE_BINPKG="${GKPKG_STRACE_BINPKG:-%%CACHE%%/strace-${GKPKG_STRACE_PV}-%%ARCH%%.tar.xz}" + GKPKG_UNIONFS_FUSE_PN="unionfs-fuse" GKPKG_UNIONFS_FUSE_PV="${GKPKG_UNIONFS_FUSE_PV:-VERSION_UNIONFS_FUSE}" GKPKG_UNIONFS_FUSE_DEPS="fuse" diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 2131f77..e740087 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -448,6 +448,10 @@ parse_cmdline() { fi print_info 2 "CMD_SSH_HOST_KEYS: ${CMD_SSH_HOST_KEYS}" ;; + --strace|--no-strace) + CMD_STRACE=$(parse_optbool "$*") + print_info 2 "CMD_STRACE: ${CMD_STRACE}" + ;; --loglevel=*) CMD_LOGLEVEL="${*#*=}" LOGLEVEL="${CMD_LOGLEVEL}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 75b7b3b..b5052eb 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -146,6 +146,7 @@ determine_real_args() { set_config_with_override BOOL SSH CMD_SSH "no" set_config_with_override STRING SSH_AUTHORIZED_KEYS_FILE CMD_SSH_AUTHORIZED_KEYS_FILE "/etc/dropbear/authorized_keys" set_config_with_override STRING SSH_HOST_KEYS CMD_SSH_HOST_KEYS "create" + set_config_with_override BOOL STRACE CMD_STRACE "no" set_config_with_override BOOL LVM CMD_LVM "no" set_config_with_override BOOL DMRAID CMD_DMRAID "no" set_config_with_override BOOL ISCSI CMD_ISCSI "no" diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 45bf4fe..41f0269 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -828,6 +828,26 @@ append_splash() { || gen_die "Failed to append splash to cpio!" } +append_strace() { + local PN=strace + local TDIR="${TEMP}/initramfs-${PN}-temp" + if [ -d "${TDIR}" ] + then + rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!" + fi + + populate_binpkg ${PN} + + mkdir -p "${TDIR}" || gen_die "Failed to create '${TDIR}'!" + + unpack "$(get_gkpkg_binpkg "${PN}")" "${TDIR}" + + cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!" + log_future_cpio_content + find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ + || gen_die "Failed to append ${PN} to cpio!" +} + append_overlay() { cd "${INITRAMFS_OVERLAY}" || gen_die "Failed to chdir to '${INITRAMFS_OVERLAY}'!" @@ -1482,6 +1502,7 @@ create_initramfs() { append_data 'modprobed' append_data 'multipath' "${MULTIPATH}" append_data 'splash' "${SPLASH}" + append_data 'strace' "${STRACE}" append_data 'unionfs_fuse' "${UNIONFS}" append_data 'xfsprogs' "${XFSPROGS}" append_data 'zfs' "${ZFS}" diff --git a/gkbuilds/strace.gkbuild b/gkbuilds/strace.gkbuild new file mode 100644 index 0000000..540f6cb --- /dev/null +++ b/gkbuilds/strace.gkbuild @@ -0,0 +1,25 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +src_configure() { + append-ldflags -static -pthread + export ac_cv_header_libaio_h=yes + + local myconf=( + --enable-mpers=check + --without-libunwind + --without-libdw + ) + + gkconf "${myconf[@]}" +} + +src_install() { + mkdir -p "${D}"/usr/bin || die "Failed to create '${D}/usr/bin'!" + + cp -a strace "${D}"/usr/bin/ \ + || die "Failed to copy '${S}/strace' to '${D}/usr/bin/'!" + + "${STRIP}" --strip-all "${D}"/usr/bin/strace \ + || die "Failed to strip '${D}/usr/bin/strace'!" +}