[CFT] ssh/scp/ssh-add/ssh-agent/ssh-keygen on /rescue

Norikatsu Shigemura nork at FreeBSD.org
Sun May 24 10:26:20 UTC 2009


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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


More information about the freebsd-stable mailing list