From owner-freebsd-hackers@FreeBSD.ORG Sun May 24 10:26:19 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C089C106564A; Sun, 24 May 2009 10:26:19 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from sakura.ninth-nine.com (unknown [IPv6:2001:2f0:104:80a0:21b:78ff:fe37:f1cf]) by mx1.freebsd.org (Postfix) with ESMTP id 4D1E48FC14; Sun, 24 May 2009 10:26:19 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com (ns1.ninth-nine.com [219.127.74.121]) (authenticated bits=0) by sakura.ninth-nine.com (8.14.3/8.14.3/NinthNine) with ESMTP id n4OAQBoo059049; Sun, 24 May 2009 19:26:16 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Sun, 24 May 2009 19:26:11 +0900 From: Norikatsu Shigemura To: freebsd-hackers@FreeBSD.org Message-Id: <20090524192611.9becb1bc.nork@FreeBSD.org> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: imp@FreeBSD.org, freebsd-current@FreeBSD.org, freebsd-stable@FreeBSD.org Subject: [CFT] ssh/scp/ssh-add/ssh-agent/ssh-keygen on /rescue X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2009 10:26:20 -0000 Hi. I wondered that ssh/scp (at least) was not in /rescue. They are the indispensable tools, and I also often use them in the emergency (single user mode). So I made a patch for src/rescue/rescue/Makefile and src/secure/usr.bin/scp/Makefile. Please review it. Changing point is: o Move some libraries to Common Libraries section. o Add ssh/scp/ssh-add/ssh-agent/ssh-keygen to /rescue member. o Cosmetics Change (labeled Common Libraries section). Sorry, this patch for 8-current. I'll try to MFC after kmacy's zfs/zpool support. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- rescue/rescue/Makefile.orig 2009-05-23 11:30:38.830094000 +0900 +++ rescue/rescue/Makefile 2009-05-24 18:58:08.925195062 +0900 @@ -72,7 +72,7 @@ CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \ ed expr getfacl hostname kenv kill ln ls mkdir mv \ pkill ps pwd realpath rm rmdir setfacl sh stty sync test -CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil +CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap # Additional options for specific programs CRUNCH_ALIAS_test= [ @@ -143,7 +143,7 @@ .if ${MK_ZFS} != "no" CRUNCH_LIBS+= -lzfs -lnvpair -luutil -lavl .endif -CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lreadline -lsbuf -lufs -lz +CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lreadline -lsbuf -lufs .if ${MACHINE_ARCH} == "i386" CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk @@ -206,13 +206,9 @@ CRUNCH_PROGS_usr.bin+= bzip2 CRUNCH_ALIAS_bzip2= bunzip2 bzcat -CRUNCH_LIBS+= -lbz2 CRUNCH_PROGS_usr.bin+= tar -CRUNCH_LIBS+= -larchive -lmd -.if ${MK_OPENSSL} != "no" -CRUNCH_LIBS+= -lcrypto -.endif +CRUNCH_LIBS+= -larchive CRUNCH_PROGS_usr.bin+= vi CRUNCH_ALIAS_vi= ex @@ -220,6 +216,25 @@ CRUNCH_PROGS_usr.bin+= id CRUNCH_ALIAS_id= groups whoami +.if ${MK_OPENSSL} != "no" && ${MK_OPENSSH} != "no" +CRUNCH_PROGS_usr.bin+= ssh +CRUNCH_PROGS_usr.bin+= scp +CRUNCH_BUILDOPTS_scp= BINDIR=${BINDIR} +CRUNCH_PROGS_usr.bin+= ssh-add +CRUNCH_PROGS_usr.bin+= ssh-agent +CRUNCH_PROGS_usr.bin+= ssh-keygen +CRUNCH_LIBS+= -lssh +.if ${MK_KERBEROS_SUPPORT} != "no" +CRUNCH_LIBS+= -lgssapi +.endif + +CRUNCH_SRCDIR_ssh= ${.CURDIR}/../../secure/usr.bin/ssh +CRUNCH_SRCDIR_scp= ${.CURDIR}/../../secure/usr.bin/scp +CRUNCH_SRCDIR_ssh-add= ${.CURDIR}/../../secure/usr.bin/ssh-add +CRUNCH_SRCDIR_ssh-agent= ${.CURDIR}/../../secure/usr.bin/ssh-agent +CRUNCH_SRCDIR_ssh-keygen= ${.CURDIR}/../../secure/usr.bin/ssh-keygen +.endif + ################################################################## # Programs from stock /usr/sbin # @@ -229,8 +244,14 @@ CRUNCH_PROGS_usr.sbin+= chown CRUNCH_ALIAS_chown= chgrp + ################################################################## -CRUNCH_LIBS+= -lm +# Common Libraries +# +.if ${MK_OPENSSL} != "no" +CRUNCH_LIBS+= -lcrypto +.endif +CRUNCH_LIBS+= -lmd -lutil -lbz2 -lz -lm ################################################################## # The following is pretty nearly a generic crunchgen-handling makefile --- secure/usr.bin/scp/Makefile.orig 2006-05-14 06:38:15.000000000 +0900 +++ secure/usr.bin/scp/Makefile 2009-05-24 15:39:20.594368170 +0900 @@ -1,7 +1,7 @@ # $FreeBSD: src/secure/usr.bin/scp/Makefile,v 1.16 2006/05/13 21:38:15 des Exp $ PROG= scp -CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +CFLAGS+=-I${SSHDIR} -include ssh_namespace.h -D_PATH_SSH_PROGRAM='"${BINDIR}/ssh"' DPADD= ${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} LDADD= -lssh -lcrypt -lcrypto -lz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -