[Glibc-bsd-commits] r5238 - in trunk/kfreebsd-11/debian: . patches

rmh at alioth.debian.org rmh at alioth.debian.org
Tue Dec 17 21:25:24 UTC 2013


Author: rmh
Date: 2013-12-17 21:25:24 +0000 (Tue, 17 Dec 2013)
New Revision: 5238

Added:
   trunk/kfreebsd-11/debian/patches/ldscript_output_format.diff
   trunk/kfreebsd-11/debian/patches/unescaped_kern_ident.diff
Modified:
   trunk/kfreebsd-11/debian/changelog
   trunk/kfreebsd-11/debian/patches/series
   trunk/kfreebsd-11/debian/rules
Log:
Remove the kludges that modify srcdir in build target. Use override variables instead when possible. This will allow sharing the srcdir later.

Modified: trunk/kfreebsd-11/debian/changelog
===================================================================
--- trunk/kfreebsd-11/debian/changelog	2013-12-17 21:23:32 UTC (rev 5237)
+++ trunk/kfreebsd-11/debian/changelog	2013-12-17 21:25:24 UTC (rev 5238)
@@ -6,6 +6,9 @@
   * Build with CTF debug information, and enable KDTRACE_HOOKS (DTrace
     hooks) and DDB_CTF (CTF support in ELF loader) for debug builds.
   * Fetch source code securely (https) in get-orig-source.
+  * Remove the kludges that modify srcdir in build target. Use override
+    variables instead when possible. This will allow sharing the srcdir
+    later.
 
  -- Robert Millan <rmh at debian.org>  Fri, 29 Nov 2013 14:05:10 +0100
 

Added: trunk/kfreebsd-11/debian/patches/ldscript_output_format.diff
===================================================================
--- trunk/kfreebsd-11/debian/patches/ldscript_output_format.diff	                        (rev 0)
+++ trunk/kfreebsd-11/debian/patches/ldscript_output_format.diff	2013-12-17 21:25:24 UTC (rev 5238)
@@ -0,0 +1,21 @@
+
+Explicit OUTPUT_FORMAT prevents ld from working on GNU/Linux, as the
+"-freebsd" variant is not present there. However, both formats work
+fine for the purpose of building a kernel.
+
+--- a/sys/conf/ldscript.amd64
++++ b/sys/conf/ldscript.amd64
+@@ -1,5 +1,4 @@
+ /* $FreeBSD$ */
+-OUTPUT_FORMAT("elf64-x86-64-freebsd", "elf64-x86-64-freebsd", "elf64-x86-64-freebsd")
+ OUTPUT_ARCH(i386:x86-64)
+ ENTRY(btext)
+ SEARCH_DIR("/usr/lib");
+--- a/sys/conf/ldscript.i386
++++ b/sys/conf/ldscript.i386
+@@ -1,5 +1,4 @@
+ /* $FreeBSD$ */
+-OUTPUT_FORMAT("elf32-i386-freebsd", "elf32-i386-freebsd", "elf32-i386-freebsd")
+ OUTPUT_ARCH(i386)
+ ENTRY(btext)
+ SEARCH_DIR(/usr/lib);

Modified: trunk/kfreebsd-11/debian/patches/series
===================================================================
--- trunk/kfreebsd-11/debian/patches/series	2013-12-17 21:23:32 UTC (rev 5237)
+++ trunk/kfreebsd-11/debian/patches/series	2013-12-17 21:25:24 UTC (rev 5238)
@@ -2,6 +2,8 @@
 
 # Patches that are in good shape for merging upstream
 mount_remount.diff
+ldscript_output_format.diff
+unescaped_kern_ident.diff
 
 # Other patches that might or might not be mergeable
 userland.diff

Added: trunk/kfreebsd-11/debian/patches/unescaped_kern_ident.diff
===================================================================
--- trunk/kfreebsd-11/debian/patches/unescaped_kern_ident.diff	                        (rev 0)
+++ trunk/kfreebsd-11/debian/patches/unescaped_kern_ident.diff	2013-12-17 21:25:24 UTC (rev 5238)
@@ -0,0 +1,16 @@
+
+This argument breaks build if your KERN_IDENT contains special characters.
+
+It's not being used anyway, so remove it.
+
+--- a/sys/conf/kern.post.mk
++++ b/sys/conf/kern.post.mk
+@@ -286,7 +286,7 @@
+ 	${NORMAL_LINT}
+ 
+ vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP}
+-	MAKE=${MAKE} sh $S/conf/newvers.sh ${KERN_IDENT}
++	MAKE=${MAKE} sh $S/conf/newvers.sh
+ 
+ vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src
+ 	${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -c

Modified: trunk/kfreebsd-11/debian/rules
===================================================================
--- trunk/kfreebsd-11/debian/rules	2013-12-17 21:23:32 UTC (rev 5237)
+++ trunk/kfreebsd-11/debian/rules	2013-12-17 21:25:24 UTC (rev 5238)
@@ -168,33 +168,22 @@
 	cp -af sys $(FLAVOR_DIR)-$*/
 	touch $@
 build-flavor-%-stamp: src-flavor-%-stamp
-	# Add the abiname and the flavor to the kernel version
-	sed -i -e 's/^RELEASE=".*"/RELEASE="$(version)-$(abiname)-$*"/g' $(FLAVOR_DIR)-$*/sys/conf/newvers.sh
-
-	# Change ident to the kernel version
-	sed -i -e 's/^i=.*/i="Debian $* ($(full_version))"/g' $(FLAVOR_DIR)-$*/sys/conf/newvers.sh
-
-	# Override module dir
-	sed -i -e 's,^KODIR?=.*,KODIR="/boot/modules/$(version)-$(abiname)-$*",g' $(FLAVOR_DIR)-$*/sys/conf/kern.pre.mk
-
-	# Always set explicit link target to match with ld's implicit target (needed
-	# to build on non-kFreeBSD)
-	sed -i \
-		-e 's/elf32-i386-freebsd/$(ld_target)/g' \
-		-e 's/elf64-x86-64-freebsd/$(ld_target)/g' \
-		-e 's/elf32-tradlittlemips-freebsd/$(ld_target)/g' \
-		-e 's/elf32-tradbigmips-freebsd/$(ld_target)/g' \
-	$(FLAVOR_DIR)-$*/sys/conf/ldscript.$(kfreebsd_cpu)
-
 	# Configure the kernel
 	cp debian/arch/$(cpu)/$*.config $(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/conf/
 	ln -sf $*.config $(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/conf/$(configfile)
 	cd $(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/conf \
 		&& config $(configfile)
 
+	# Change ident to the kernel version
+	sed -i -e 's/^KERN_IDENT=.*/KERN_IDENT=Debian $* ($(full_version))/g' \
+		$(FLAVOR_DIR)-$*/sys/amd64/compile/DEBCUSTOM/Makefile
+
 	# Build it
-	$(MAKE) CC=$(cc_cmd) -C $(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/compile/$(configfile)/ depend
-	$(MAKE) CC=$(cc_cmd) -C $(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/compile/$(configfile)/
+	$(MAKE) \
+		BRANCH_OVERRIDE="$(abiname)-$*" \
+		CC=$(cc_cmd) \
+		-C $(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/compile/$(configfile)/ \
+		depend all
 
 	touch build-flavor-$*-stamp
 
@@ -228,9 +217,8 @@
 	dh_testroot
 	dh_clean -k -pkfreebsd-image-$(version)-$(abiname)-$*
 
-	mkdir -p $(IMAGE_PACKAGE)-$*/boot/modules/$(version)-$(abiname)-$*
-
 	# make the install target happy
+	mkdir -p $(IMAGE_PACKAGE)-$*/boot
 	install -o root -g root -m 644 \
 		$(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/conf/GENERIC.hints \
 		$(IMAGE_PACKAGE)-$*/boot/device.hints || touch $(IMAGE_PACKAGE)-$*/boot/device.hints
@@ -249,12 +237,23 @@
 
 	# now install the kernel
 	$(MAKE) CC=$(cc_cmd) -C $(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/compile/$(configfile) DESTDIR=$(IMAGE_PACKAGE)-$* install
-	mv $(IMAGE_PACKAGE)-$*/boot/modules/$(version)-$(abiname)-$*/kernel $(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$*
+
+	# reallocate kernel image
+	mv \
+		$(IMAGE_PACKAGE)-$*/boot/kernel/kernel \
+		$(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$*
 	chmod 644 $(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$*
 	gzip -9 -n $(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$*
 
-	# fix broken perms in module dir
+	# reallocate module dir (sans kernel image)
+	mkdir -p $(IMAGE_PACKAGE)-$*/lib/modules $(IMAGE_PACKAGE)-$*/boot/modules
+	mv \
+		$(IMAGE_PACKAGE)-$*/boot/kernel \
+		$(IMAGE_PACKAGE)-$*/boot/modules/$(version)-$(abiname)-$*
 	-chmod 644 $(IMAGE_PACKAGE)-$*/boot/modules/$(version)-$(abiname)-$*/*
+	ln -s \
+		../../boot/modules/$(version)-$(abiname)-$* \
+		$(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*
 
 	# remove loader.conf (part of kfreebsd-loader)
 	rm -f $(IMAGE_PACKAGE)-$*/boot/loader.conf
@@ -263,13 +262,6 @@
 	# remove device.hints (built into kernel)
 	rm -f $(IMAGE_PACKAGE)-$*/boot/device.hints
 
-	# compatibility symlink
-	mkdir -p $(IMAGE_PACKAGE)-$*/lib/modules
-	ln -s \
-		../../boot/modules/$(version)-$(abiname)-$* \
-		$(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*
-
-
 	# README file
 	mkdir -p $(IMAGE_PACKAGE)-$*/usr/share/doc/kfreebsd-image-$(version)-$(abiname)-$*
 	install -p -o root -g root -m 644 \




More information about the Glibc-bsd-commits mailing list