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 D3C4C1382C5 for ; Wed, 20 May 2020 03:42:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 079D9E0827; Wed, 20 May 2020 03:42:37 +0000 (UTC) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 A0C4DE0827 for ; Wed, 20 May 2020 03:42:36 +0000 (UTC) Received: by mail-pf1-f173.google.com with SMTP id n15so929157pfd.0 for ; Tue, 19 May 2020 20:42:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=n2DbO2o1or+PrA0oxXulgBfOcy35BCIDbEZglJixBGI=; b=dtB+105PzArbBRWxdZaEYJ/yZEXzPRd8auBl2CnBt83hyFcKrGRiAPrlvz23JlTkeZ bCd/HoyrZspY8AoehZj7S1ADAqCMyWfg8ywY944WIPiquqM7WrLffcsT5EWlc/91IdIJ /khq6adxk83GNUfihmAORNHyJcMN9Pff9lzZm5g482EREDwCWTUqYXi8sHsbzCXTJepB Ymv5OIMjTAQynK9I65/7CW7xfUoptpLjcJ8rWymPB6vOiW+IYCDdlPzyN77KlNFc2g/f 3J0iy98ndhCdpx2tYXhw7Fqc29rAW0vkYufGaPo91MNomr8SaEhmfeTEs/DKPrnSr7pi BUEg== X-Gm-Message-State: AOAM532W8ej/gob9sCSr277f1P22S8oNnDIbx1ZMN4zgAGjJ5+d16Alz Uf/hMjxctz/8/3O1kY+xtTRqPKVe X-Google-Smtp-Source: ABdhPJx9FtBE5baYR+EBvrIqk1jUU202VFFSMmwy8crcItqwBD/XGKMWedsYZ5wGn4smWng8HUx6kw== X-Received: by 2002:a65:518c:: with SMTP id h12mr2138143pgq.17.1589946154893; Tue, 19 May 2020 20:42:34 -0700 (PDT) Received: from localhost ([134.134.137.77]) by smtp.gmail.com with ESMTPSA id y7sm749828pjn.13.2020.05.19.20.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 20:42:33 -0700 (PDT) From: Matt Turner To: gentoo-catalyst@lists.gentoo.org Cc: Matt Turner Subject: [gentoo-catalyst] [PATCH 01/21] targets: Remove copy_{file,symlink,lib} functions Date: Tue, 19 May 2020 20:42:06 -0700 Message-Id: <20200520034226.2870937-1-mattst88@gentoo.org> X-Mailer: git-send-email 2.26.2 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 7b897e56-9c3a-434f-855c-9cd79f609515 X-Archives-Hash: 86f2abc3ba402ad8929772051b192437 Unused since the removal of the original netboot target. I'm honestly kind of impressed with the strategy of running ldd and recursively copying libraries to the netboot image. Unfortunately for this strategy, dlopen() exists so this cannot work. Fixes: 89f57e145f82 (targets: Delete the netboot target) Signed-off-by: Matt Turner --- targets/support/chroot-functions.sh | 75 ----------------------------- 1 file changed, 75 deletions(-) diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh index d40279ae..d63e4918 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -335,81 +335,6 @@ run_default_funcs() { fi } -# Functions -# Copy libs of a executable in the chroot -function copy_libs() { - # Check if it's a dynamix exec - ldd ${1} > /dev/null 2>&1 || return - - for lib in `ldd ${1} | awk '{ print $3 }'` - do - echo ${lib} - if [ -e ${lib} ] - then - if [ ! -e ${clst_root_path}/${lib} ] - then - copy_file ${lib} - [ -e "${clst_root_path}/${lib}" ] && \ - strip -R .comment -R .note ${clst_root_path}/${lib} \ - || echo "WARNING : Cannot strip lib ${clst_root_path}/${lib} !" - fi - else - echo "WARNING : Some library was not found for ${lib} !" - fi - done -} - -function copy_symlink() { - STACK=${2} - [ "${STACK}" = "" ] && STACK=16 || STACK=$((${STACK} - 1 )) - - if [ ${STACK} -le 0 ] - then - echo "WARNING : ${TARGET} : too many levels of symbolic links !" - return - fi - - [ ! -e ${clst_root_path}/`dirname ${1}` ] && \ - mkdir -p ${clst_root_path}/`dirname ${1}` - [ ! -e ${clst_root_path}/${1} ] && \ - cp -vfdp ${1} ${clst_root_path}/${1} - - if [[ -n $(type -p realpath) ]]; then - TARGET=`realpath ${1}` - else - TARGET=`readlink -f ${1}` - fi - if [ -h ${TARGET} ] - then - copy_symlink ${TARGET} ${STACK} - else - copy_file ${TARGET} - fi -} - -function copy_file() { - f="${1}" - - if [ ! -e "${f}" ] - then - echo "WARNING : File not found : ${f}" - continue - fi - - [ ! -e ${clst_root_path}/`dirname ${f}` ] && \ - mkdir -p ${clst_root_path}/`dirname ${f}` - [ ! -e ${clst_root_path}/${f} ] && \ - cp -vfdp ${f} ${clst_root_path}/${f} - if [ -x ${f} -a ! -h ${f} ] - then - copy_libs ${f} - strip -R .comment -R .note ${clst_root_path}/${f} > /dev/null 2>&1 - elif [ -h ${f} ] - then - copy_symlink ${f} - fi -} - create_handbook_icon() { # This function creates a local icon to the Gentoo Handbook echo "[Desktop Entry] -- 2.26.2