Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jun 2018 16:24:42 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335321 - in head/stand: . geli i386/gptboot i386/gptzfsboot i386/isoboot i386/loader i386/zfsboot libsa libsa/geli
Message-ID:  <201806181624.w5IGOgUL034745@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Mon Jun 18 16:24:42 2018
New Revision: 335321
URL: https://svnweb.freebsd.org/changeset/base/335321

Log:
  stand: move libgeliboot into libsa.
  
  Reduce by 1 the number of crazy libraries we need in stand by moving
  geli into libsa (where architecturally it belonged all along). This
  just moves things around without any code changes.

Added:
  head/stand/libsa/geli/
  head/stand/libsa/geli/Makefile.inc   (contents, props changed)
     - copied, changed from r335320, head/stand/geli/Makefile
  head/stand/libsa/geli/geliboot.c   (contents, props changed)
     - copied, changed from r335320, head/stand/geli/geliboot.c
  head/stand/libsa/geli/geliboot.h   (contents, props changed)
     - copied, changed from r335320, head/stand/geli/geliboot.h
  head/stand/libsa/geli/geliboot_crypto.c   (contents, props changed)
     - copied, changed from r335320, head/stand/geli/geliboot_crypto.c
  head/stand/libsa/geli/geliboot_internal.h   (contents, props changed)
     - copied, changed from r335320, head/stand/geli/geliboot_internal.h
  head/stand/libsa/geli/pwgets.c   (contents, props changed)
     - copied, changed from r335320, head/stand/geli/pwgets.c
Deleted:
  head/stand/geli/Makefile
  head/stand/geli/Makefile.depend
  head/stand/geli/geliboot.c
  head/stand/geli/geliboot.h
  head/stand/geli/geliboot_crypto.c
  head/stand/geli/geliboot_internal.h
  head/stand/geli/pwgets.c
Modified:
  head/stand/Makefile
  head/stand/defs.mk
  head/stand/i386/gptboot/Makefile
  head/stand/i386/gptzfsboot/Makefile
  head/stand/i386/isoboot/Makefile
  head/stand/i386/loader/Makefile
  head/stand/i386/zfsboot/Makefile
  head/stand/libsa/Makefile

Modified: head/stand/Makefile
==============================================================================
--- head/stand/Makefile	Mon Jun 18 15:37:43 2018	(r335320)
+++ head/stand/Makefile	Mon Jun 18 16:24:42 2018	(r335321)
@@ -21,8 +21,6 @@ S.${MK_ZFS}+=		zfs
 S.yes+=			defaults
 S.yes+=			man
 
-S.${MK_LOADER_GELI}+=	geli
-
 .include <bsd.arch.inc.mk>
 
 S.${MK_EFI}+=		efi

Modified: head/stand/defs.mk
==============================================================================
--- head/stand/defs.mk	Mon Jun 18 15:37:43 2018	(r335320)
+++ head/stand/defs.mk	Mon Jun 18 16:24:42 2018	(r335321)
@@ -67,8 +67,7 @@ MK_LOADER_GELI=yes
 .endif
 .if ${MK_LOADER_GELI} == "yes"
 CFLAGS+=	-DLOADER_GELI_SUPPORT
-CFLAGS+=	-I${BOOTSRC}/geli
-LIBGELIBOOT=	${BOOTOBJ}/geli/libgeliboot.a
+CFLAGS+=	-I${SASRC}/geli
 .endif # MK_LOADER_GELI
 .endif # HAVE_GELI
 

Modified: head/stand/i386/gptboot/Makefile
==============================================================================
--- head/stand/i386/gptboot/Makefile	Mon Jun 18 15:37:43 2018	(r335320)
+++ head/stand/i386/gptboot/Makefile	Mon Jun 18 16:24:42 2018	(r335321)
@@ -64,7 +64,7 @@ gptboot.bin: gptboot.out
 	${OBJCOPY} -S -O binary gptboot.out ${.TARGET}
 
 gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS}
-	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32}
+	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
 
 .include <bsd.prog.mk>
 

Modified: head/stand/i386/gptzfsboot/Makefile
==============================================================================
--- head/stand/i386/gptzfsboot/Makefile	Mon Jun 18 15:37:43 2018	(r335320)
+++ head/stand/i386/gptzfsboot/Makefile	Mon Jun 18 16:24:42 2018	(r335321)
@@ -75,7 +75,7 @@ gptzfsboot.bin: gptzfsboot.out
 
 gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \
 	${OPENCRYPTO_XTS}
-	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32}
+	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32}
 
 zfsboot.o: ${ZFSSRC}/zfsimpl.c
 

Modified: head/stand/i386/isoboot/Makefile
==============================================================================
--- head/stand/i386/isoboot/Makefile	Mon Jun 18 15:37:43 2018	(r335320)
+++ head/stand/i386/isoboot/Makefile	Mon Jun 18 16:24:42 2018	(r335321)
@@ -66,6 +66,6 @@ isoboot.bin: isoboot.out
 	${OBJCOPY} -S -O binary isoboot.out ${.TARGET}
 
 isoboot.out: ${BTXCRT} isoboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS}
-	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32}
+	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
 
 .include <bsd.prog.mk>

Modified: head/stand/i386/loader/Makefile
==============================================================================
--- head/stand/i386/loader/Makefile	Mon Jun 18 15:37:43 2018	(r335320)
+++ head/stand/i386/loader/Makefile	Mon Jun 18 16:24:42 2018	(r335321)
@@ -71,8 +71,8 @@ FILESMODE_${LOADER}= ${BINMODE} -b
 # XXX crt0.o needs to be first for pxeboot(8) to work
 OBJS=	${BTXCRT}
 
-DPADD=	${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32}
-LDADD=	${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32}
+DPADD=	${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSA32}
+LDADD=	${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSA32}
 
 .if ${MACHINE_CPUARCH} == "amd64"
 CFLAGS+=	-DLOADER_PREFER_AMD64

Modified: head/stand/i386/zfsboot/Makefile
==============================================================================
--- head/stand/i386/zfsboot/Makefile	Mon Jun 18 15:37:43 2018	(r335320)
+++ head/stand/i386/zfsboot/Makefile	Mon Jun 18 16:24:42 2018	(r335321)
@@ -82,7 +82,7 @@ zfsboot.bin: zfsboot.out
 	${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
 
 zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o
-	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBGELIBOOT} ${LIBSA32}
+	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32}
 
 SRCS=	zfsboot.c
 

Modified: head/stand/libsa/Makefile
==============================================================================
--- head/stand/libsa/Makefile	Mon Jun 18 15:37:43 2018	(r335320)
+++ head/stand/libsa/Makefile	Mon Jun 18 16:24:42 2018	(r335321)
@@ -151,4 +151,9 @@ CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2
 .PATH: ${SYSDIR}/libkern
 SRCS+=  explicit_bzero.c
 
+# Maybe GELI
+.if ${MK_LOADER_GELI} == "yes"
+.include "${SASRC}/geli/Makefile.inc"
+.endif
+
 .include <bsd.lib.mk>

Copied and modified: head/stand/libsa/geli/Makefile.inc (from r335320, head/stand/geli/Makefile)
==============================================================================
--- head/stand/geli/Makefile	Mon Jun 18 15:37:43 2018	(r335320, copy source)
+++ head/stand/libsa/geli/Makefile.inc	Mon Jun 18 16:24:42 2018	(r335321)
@@ -1,12 +1,10 @@
 # $FreeBSD$
-# libgeliboot
+# Extra stuff for GELI
 
-DO32=1
+.PATH: ${SASRC}/geli
 
-.include <bsd.init.mk>
+CFLAGS+=	-I${LDRSRC}
 
-LIB=		geliboot
-
 # Our password input method
 SRCS+=  pwgets.c
 
@@ -21,10 +19,11 @@ SRCS+=		md5c.c
 
 # AES implementation from sys/crypto
 .PATH: ${SYSDIR}/crypto/rijndael
-CFLAGS+=	-I${LDRSRC}
-# Remove asserts
-CFLAGS+=	-DNDEBUG
-SRCS+=		rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c
+.for i in rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c
+# Remove asserts XXX BAD
+CFLAGS.${i}+=	-DNDEBUG
+SRCS+=		${i}
+.endfor
 
 # local GELI Implementation
 .PATH: ${SYSDIR}/geom/eli
@@ -33,5 +32,3 @@ SRCS+=		geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_e
 # aes
 .PATH:		${SYSDIR}/opencrypto
 SRCS+=		xform_aes_xts.c
-
-.include <bsd.lib.mk>

Copied and modified: head/stand/libsa/geli/geliboot.c (from r335320, head/stand/geli/geliboot.c)
==============================================================================

Copied and modified: head/stand/libsa/geli/geliboot.h (from r335320, head/stand/geli/geliboot.h)
==============================================================================

Copied and modified: head/stand/libsa/geli/geliboot_crypto.c (from r335320, head/stand/geli/geliboot_crypto.c)
==============================================================================
--- head/stand/geli/geliboot_crypto.c	Mon Jun 18 15:37:43 2018	(r335320, copy source)
+++ head/stand/libsa/geli/geliboot_crypto.c	Mon Jun 18 16:24:42 2018	(r335321)
@@ -71,7 +71,7 @@ geliboot_crypt(u_int algo, int enc, u_char *data, size
 		}
 		if (datasize != (blks / 8)) {
 			printf("Failed to decrypt the entire input: "
-			    "%u != %u\n", blks, datasize);
+			    "%u != %zu\n", blks, datasize);
 			return (1);
 		}
 		break;

Copied and modified: head/stand/libsa/geli/geliboot_internal.h (from r335320, head/stand/geli/geliboot_internal.h)
==============================================================================

Copied and modified: head/stand/libsa/geli/pwgets.c (from r335320, head/stand/geli/pwgets.c)
==============================================================================



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806181624.w5IGOgUL034745>