From patchwork Mon Sep 30 08:25:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Kjaergaard X-Patchwork-Id: 278961 X-Patchwork-Delegate: esben@haabendal.dk Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hugin.dotsrc.org (hugin.dotsrc.org [IPv6:2001:878:346::102]) by ozlabs.org (Postfix) with ESMTP id 770432C008A for ; Mon, 30 Sep 2013 18:26:07 +1000 (EST) Received: from hugin.dotsrc.org (localhost [127.0.0.1]) by hugin.dotsrc.org (Postfix) with ESMTP id 311F43FA48 for ; Mon, 30 Sep 2013 10:26:06 +0200 (CEST) X-Original-To: dev@oe-lite.org Delivered-To: dev@oe-lite.org Received: from mail01.prevas.se (mail01.prevas.se [62.95.78.3]) by hugin.dotsrc.org (Postfix) with ESMTPS id 018373FDEE for ; Mon, 30 Sep 2013 10:26:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=prevas.dk; i=@prevas.dk; l=4349; q=dns/txt; s=ironport1; t=1380529563; x=1412065563; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=AFd4TkdUaiPcYq3mZT2cB7XYr2RDAIguJUQBR6cHrzY=; b=lMP40d6dKkb8Dd/x9vGAP1qkHe1TFJxApObX9b0X1tFMBkW/E1fQ/8Qd 56yaTwarvsVIHRlZudENF+vH18t3cAU5rqaEJsxQi9gHOc7d+rtFSru5B IUm8NkEAApHtbUPzE+JExrfOqc4L4B2OUa+Z+RrMAgnbA89BhrEMg25r1 0=; X-IronPort-AV: E=Sophos;i="4.90,1006,1371074400"; d="scan'208";a="3973695" Received: from vmprevas3.prevas.se (HELO smtp.prevas.se) ([172.16.8.103]) by ironport1.prevas.se with ESMTP/TLS/AES128-SHA; 30 Sep 2013 10:26:03 +0200 Received: from arh116.prevas.se (172.16.11.2) by smtp.prevas.se (172.16.8.105) with Microsoft SMTP Server (TLS) id 14.2.347.0; Mon, 30 Sep 2013 10:26:03 +0200 From: To: Subject: [base 12/13] openssh/sftp-server: sftp-server remove libcrypto dependency. Date: Mon, 30 Sep 2013 10:25:54 +0200 Message-ID: <70bd5d021bc56870050d2a7fe15856bd26f9cbf9.1380529272.git.jacob.kjaergaard@prevas.dk> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [172.16.11.2] X-BeenThere: dev@oe-lite.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: OE-lite development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dev-bounces@oe-lite.org Errors-To: dev-bounces@oe-lite.org From: Jacob Kjaergaard sftp-server does not use libcrypto at all but is dynamically linked against it. in systems with small footprint requirement where only the sftp-server is used this requires an additional 1.6MB. This patch circumvents the linking against that lib for sftp-server and libcrypto can be omitted runtime --- .../openssh/files/sftp-server-skip-libcrypto.patch | 14 ++++++++++++ recipes/openssh/openssh.inc | 23 ++++++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 recipes/openssh/files/sftp-server-skip-libcrypto.patch diff --git a/recipes/openssh/files/sftp-server-skip-libcrypto.patch b/recipes/openssh/files/sftp-server-skip-libcrypto.patch new file mode 100644 index 0000000..94b8f96 --- /dev/null +++ b/recipes/openssh/files/sftp-server-skip-libcrypto.patch @@ -0,0 +1,14 @@ +diff -c /home/jabk/projects/deif/oe-lite/tmp/work/machine/powerpc-e300c3-linux-gnu/openssh-6.1p1/src/openssh-6.1p1/Makefile.in\~ /home/jabk/projects/deif/oe-lite/tmp/work/machine/powerpc-e300c3-linux-gnu/openssh-6.1p1/src/openssh-6.1p1/Makefile.in +--- a/Makefile.in~ 2012-04-04 03:27:57.000000000 +0200 ++++ b/Makefile.in 2013-08-06 11:58:16.303164455 +0200 +@@ -166,7 +166,7 @@ + $(LD) -o $@ ssh-keyscan.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) + + sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o sftp-server-main.o +- $(LD) -o $@ sftp-server.o sftp-common.o sftp-server-main.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) ++ $(LD) -o $@ sftp-server.o sftp-common.o sftp-server-main.o $(LDFLAGS) -lssh -lopenbsd-compat $(SFTP_LIBS) + + sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o + $(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT) + +Diff finished. Tue Aug 6 11:58:21 2013 diff --git a/recipes/openssh/openssh.inc b/recipes/openssh/openssh.inc index 75d5795..9c032c5 100644 --- a/recipes/openssh/openssh.inc +++ b/recipes/openssh/openssh.inc @@ -17,6 +17,7 @@ inherit autotools passwd SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz" SRC_URI += "file://sshd_config file://ssh_config file://init" SRC_URI += "file://passwd file://group" +SRC_URI += "file://sftp-server-skip-libcrypto.patch" DEPENDS = "libcrypto libssl libz ${DEPENDS_LIBC}" DEPENDS_LIBC = "libdl libutil libresolv libcrypt" @@ -26,7 +27,7 @@ export ASKPASS_PROGRAM = "${bindir}/ssh-askpass" export LD = "${CC}" CFLAGS =+ "-I${S} " CFLAGS += "-D__FILE_OFFSET_BITS=64" -LDFLAGS =+ "-L${S} -L${S}/openbsd-compat " +LDFLAGS =+ "-L${S} -L${S}/openbsd-compat" EXTRA_OECONF = "--disable-suid-ssh --with-ssl \ --with-rand-helper=no \ @@ -46,6 +47,13 @@ do_patch_aclocal_mangle () { fi } +#remove unnecessary crypto dependency +do_configure[postfuncs] += "do_configure_sftp_server" +do_configure_sftp_server () { + echo SFTP_LIBS=`grep ^LIBS= ${S}/Makefile | cut -b6- | sed 's/-lcrypto//'` >> ${S}/Makefile +} + + do_compile[postfuncs] += "do_compile_install_config_files" do_compile_install_config_files () { install -m 0644 ${SRCDIR}/sshd_config ${S}/ @@ -73,9 +81,20 @@ FILES_${PN}-sshd = "${sysconfdir}/init.d/sshd \ FILES_${PN}-sshd-doc = "${mandir}/*/moduli.* ${mandir}/*/sshd_config.*" RDEPENDS_${PN} += "${AUTO_PACKAGE_UTILS_PACKAGES}" -AUTO_PACKAGE_UTILS_RDEPENDS = "libc libgcc libdl libutil libcrypto libz" +AUTO_PACKAGE_UTILS_RDEPENDS = "libc libgcc libdl libutil libz" RDEPENDS_${PN}-sshd = "${PN}-keygen" +RDEPENDS_${PN}-ssh-add += "libcrypto" +RDEPENDS_${PN}-ssh-agent += "libcrypto" +RDEPENDS_${PN}-ssh-keyscan += "libcrypto" +RDEPENDS_${PN}-ssh-keygen += "libcrypto" +RDEPENDS_${PN}-ssh-keysign += "libcrypto" +RDEPENDS_${PN}-scp += "libcrypto" +RDEPENDS_${PN}-ssh += "libcrypto" +RDEPENDS_${PN}-sshd += "libcrypto" +RDEPENDS_${PN}-sftp += "libcrypto" +RDEPENDS_${PN}-ssh-pkcs11-helper += "libcrypto" + inherit sysvinit RECIPE_FLAGS = "sshd_sysvinit_start sshd_sysvinit_stop" DEFAULT_USE_sshd_sysvinit_start = "25"