Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2012 18:36:51 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r232698 - in projects/bigbb/sys/boot/i386: . boot2 boot2ufs1
Message-ID:  <201203081836.q28IapQU057028@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Thu Mar  8 18:36:51 2012
New Revision: 232698
URL: http://svn.freebsd.org/changeset/base/232698

Log:
  Split boot2 into UFS1-only and UFS2-only versions.  To get the UFS1+UFS2
  boot2, "BOOT2_UFS=UFS1_AND_UFS2" must be defined.

Added:
  projects/bigbb/sys/boot/i386/boot2ufs1/
  projects/bigbb/sys/boot/i386/boot2ufs1/Makefile   (contents, props changed)
Modified:
  projects/bigbb/sys/boot/i386/Makefile
  projects/bigbb/sys/boot/i386/boot2/Makefile

Modified: projects/bigbb/sys/boot/i386/Makefile
==============================================================================
--- projects/bigbb/sys/boot/i386/Makefile	Thu Mar  8 18:25:33 2012	(r232697)
+++ projects/bigbb/sys/boot/i386/Makefile	Thu Mar  8 18:36:51 2012	(r232698)
@@ -2,8 +2,8 @@
 
 .include <bsd.own.mk>
 
-SUBDIR=		mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot kgzldr \
-		libi386 libfirewire loader
+SUBDIR=		mbr pmbr boot0 boot0sio btx boot2 boot2ufs1 cdboot gptboot \
+		kgzldr libi386 libfirewire loader
 
 # special boot programs, 'self-extracting boot2+loader'
 SUBDIR+=	pxeldr

Modified: projects/bigbb/sys/boot/i386/boot2/Makefile
==============================================================================
--- projects/bigbb/sys/boot/i386/boot2/Makefile	Thu Mar  8 18:25:33 2012	(r232697)
+++ projects/bigbb/sys/boot/i386/boot2/Makefile	Thu Mar  8 18:36:51 2012	(r232698)
@@ -2,7 +2,9 @@
 
 .include <bsd.own.mk>
 
-FILES=		boot boot1 boot2
+FILES=		boot${BOOT_SUFFIX} boot2${BOOT2_SUFFIX}
+
+SRCDIR=		${.CURDIR}/../boot2
 
 NM?=		nm
 
@@ -18,9 +20,21 @@ ORG1=	0x7c00
 ORG2=	0x2000
 
 # Decide level of UFS support.
-BOOT2_UFS?=	UFS1_AND_UFS2
-#BOOT2_UFS?=	UFS2_ONLY
-#BOOT2_UFS?=	UFS1_ONLY
+BOOT2_UFS?=	UFS2_ONLY
+#BOOT2_UFS?=	UFS1_AND_UFS2
+
+.if ${BOOT2_UFS} != UFS1_ONLY
+FILES+=		boot1
+.endif
+.if ${BOOT2_UFS} == UFS1_ONLY
+BOOT_SUFFIX=	.ufs1
+BOOT2_SUFFIX=	ufs1
+.elif ${BOOT2_UFS} == UFS2_ONLY
+BOOT_SUFFIX=	.ufs2
+BOOT2_SUFFIX=	ufs2
+LINKS=		${BINDIR}/boot${BOOT_SUFFIX} ${BINDIR}/boot \
+		${BINDIR}/boot2${BOOT2_SUFFIX} ${BINDIR}/boot2
+.endif
 
 CFLAGS=	-Os \
 	-fno-guess-branch-probability \
@@ -50,8 +64,8 @@ LDFLAGS=-static -N --gc-sections
 
 CLEANFILES=	boot
 
-boot: boot1 boot2
-	cat boot1 boot2 > boot
+boot${BOOT_SUFFIX}: boot1 boot2${BOOT2_SUFFIX}
+	cat ${.ALLSRC} > ${.TARGET}
 
 CLEANFILES+=	boot1 boot1.out boot1.o
 
@@ -64,7 +78,7 @@ boot1.out: boot1.o
 CLEANFILES+=	boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \
 		boot2.s boot2.s.tmp boot2.h sio.o
 
-boot2: boot2.ld
+boot2${BOOT2_SUFFIX}: boot2.ld
 	@set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \
 	    echo "$$x bytes available"; test $$x -ge 0
 	dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync
@@ -88,7 +102,7 @@ boot2.o: boot2.s
 SRCS=	boot2.c boot2.h
 
 boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c
-	${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c
+	${CC} ${CFLAGS} -S -o boot2.s.tmp ${SRCDIR}/boot2.c
 	sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s
 	rm -f boot2.s.tmp
 

Added: projects/bigbb/sys/boot/i386/boot2ufs1/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/bigbb/sys/boot/i386/boot2ufs1/Makefile	Thu Mar  8 18:36:51 2012	(r232698)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../boot2
+
+BOOT2_UFS=	UFS1_ONLY
+
+.include "${.CURDIR}/../boot2/Makefile"



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