[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#820151: kfreebsd-10: non-DFSG mode (for ubuntuBSD)



Package: kfreebsd-10
Version: 10.1~svn274115-4+kbsd8u3
Severity: wishlist
Tags: patch

Hi

This patch has no effect on Debian but it enables "non-DFSG mode" when compiling kfreebsd-10 on ubuntuBSD. Please could you apply it to make it easier for us to resync with kfreebsd-10?

It also makes it easier for Debian users if they want to build a custom package with sourceless bits (by just changing one line in debian/rules).

Thanks a lot

-- 
Jon Boden

ubuntuBSD -- The power of FreeBSD kernel with familiarity of Ubuntu OS!

http://www.ubuntubsd.org/ -- https://twitter.com/ubuntuBSD
Index: debian/control.in
===================================================================
--- debian/control.in	(revision 5986)
+++ debian/control.in	(working copy)
@@ -23,6 +23,7 @@
  pkg-config,
  libsbuf-dev (>= 9.0+ds1-2),
  kernel-wedge (>= 2.79) [kfreebsd-any],
+ lsb-release,
 Standards-Version: 3.9.2
 
 Package: kfreebsd-source-@version@
Index: debian/local/ar9300_devid.h
===================================================================
--- debian/local/ar9300_devid.h	(revision 0)
+++ debian/local/ar9300_devid.h	(working copy)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2008-2011 Atheros Communications Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef __AR9300_DEVID_H__
+#define __AR9300_DEVID_H__
+
+/* Atheros chipsets */
+#define AR_SREV_VERSION_AR5416_PCI	0xD
+#define AR_SREV_VERSION_AR5416_PCIE	0xC
+#define AR_SREV_REVISION_AR5416_10	0
+#define AR_SREV_REVISION_AR5416_20	1
+#define AR_SREV_REVISION_AR5416_22	2
+#define AR_SREV_VERSION_AR9100		0x14
+#define AR_SREV_VERSION_AR9160		0x40
+#define AR_SREV_REVISION_AR9160_10	0
+#define AR_SREV_REVISION_AR9160_11	1
+#define AR_SREV_VERSION_AR9280		0x80
+#define AR_SREV_REVISION_AR9280_10	0
+#define AR_SREV_REVISION_AR9280_20	1
+#define AR_SREV_REVISION_AR9280_21	2
+#define AR_SREV_VERSION_AR9285		0xC0
+#define AR_SREV_REVISION_AR9285_10	0
+#define AR_SREV_REVISION_AR9285_11	1
+#define AR_SREV_REVISION_AR9285_12	2
+#define AR_SREV_VERSION_AR9287		0x180
+#define AR_SREV_REVISION_AR9287_10	0
+#define AR_SREV_REVISION_AR9287_11	1
+#define AR_SREV_REVISION_AR9287_12	2
+#define AR_SREV_REVISION_AR9287_13	3
+#define AR_SREV_VERSION_AR9271		0x140
+#define AR_SREV_REVISION_AR9271_10	0
+#define AR_SREV_REVISION_AR9271_11	1
+#define AR_SREV_VERSION_AR9300		0x1c0
+#define AR_SREV_REVISION_AR9300_20	2 /* 2.0 and 2.1 */
+#define AR_SREV_REVISION_AR9300_22	3
+#define AR_SREV_VERSION_AR9330		0x200
+#define AR_SREV_REVISION_AR9330_10	0
+#define AR_SREV_REVISION_AR9330_11	1
+#define AR_SREV_REVISION_AR9330_12	2
+#define AR_SREV_VERSION_AR9485		0x240
+#define AR_SREV_REVISION_AR9485_10	0
+#define AR_SREV_REVISION_AR9485_11	1
+#define AR_SREV_VERSION_AR9340		0x300
+#define AR_SREV_REVISION_AR9340_10	0
+#define AR_SREV_REVISION_AR9340_11	1
+#define AR_SREV_REVISION_AR9340_12	2
+#define AR_SREV_REVISION_AR9340_13	3
+#define AR_SREV_VERSION_AR9380		0x1C0
+#define AR_SREV_VERSION_AR9580		0x1C0
+#define AR_SREV_REVISION_AR9580_10	4 /* AR9580 1.0 */
+#define AR_SREV_VERSION_AR9460		0x280
+#define AR_SREV_VERSION_AR9462		0x280
+#define AR_SREV_REVISION_AR9462_20	2
+#define AR_SREV_REVISION_AR9462_21	3
+
+/* Qualcomm Atheros chipsets */
+#define AR_SREV_VERSION_QCA9565		0x2C0
+#define AR_SREV_REVISION_QCA9565_10	0
+#define AR_SREV_REVISION_QCA9565_101	1
+#define AR_SREV_REVISION_QCA9565_11	2
+#define AR_SREV_VERSION_QCA9550		0x400
+#define AR_SREV_VERSION_QCA9531		0x500
+#define AR_SREV_REVISION_QCA9531_10	0
+#define AR_SREV_REVISION_QCA9531_11	1
+
+#endif
Index: debian/patches/999_config.diff
===================================================================
--- debian/patches/999_config.diff	(revision 5986)
+++ debian/patches/999_config.diff	(working copy)
@@ -48,7 +48,7 @@
  options 	SYSVSHM			# SYSV-style shared memory
 --- /dev/null
 +++ b/sys/conf/DEBIAN
-@@ -0,0 +1,52 @@
+@@ -0,0 +1,49 @@
 +# Common options to all Debian GNU/kFreeBSD kernels
 +
 +options		LINPROCFS
@@ -87,9 +87,6 @@
 +options		ALTQ_HFSC	# Hierarchical Packet Scheduler (HFSC)
 +options		ALTQ_PRIQ	# Priority Queuing (PRIQ)
 +
-+# Disable binary blobs
-+include		WITHOUT_SOURCELESS
-+
 +# In order to enable IPSEC you MUST also add device crypto to
 +# your kernel configuration
 +device          crypto          # core crypto support
Index: debian/patches/series
===================================================================
--- debian/patches/series	(revision 5986)
+++ debian/patches/series	(working copy)
@@ -35,7 +35,6 @@
 924_module_objdir.diff
 999_config.diff
 aicasm-parallel-build-dependencies.diff
-ath9k-linux.diff
 
 # Security patches
 SA-15_02.kmem.patch
Index: debian/rules
===================================================================
--- debian/rules	(revision 5986)
+++ debian/rules	(working copy)
@@ -23,7 +23,13 @@
 configfile	:= DEBCUSTOM
 abiname		:= 0
 ld_target	:= $(shell ld --help | sed -ne "s/[^ :]*: supported targets: \([^ ]*\) .*/\1/p")
+distributor	:= $(shell lsb_release -is || echo Debian)
+dfsg		:= true
 
+ifeq ($(distributor), Ubuntu)
+dfsg		:= false
+endif
+
 ifeq ($(cpu), mipsel)
 kfreebsd_cpu	:= mips
 else
@@ -56,9 +62,12 @@
 MAKE		:= \
 		MAKEFLAGS=$(BSD_MAKEFLAGS) \
 		make \
-		MACHINE_ARCH=$(kfreebsd_cpu) \
-		-DWITHOUT_SOURCELESS
+		MACHINE_ARCH=$(kfreebsd_cpu)
 
+ifeq ($(dfsg), true)
+MAKE		+= -DWITHOUT_SOURCELESS
+endif
+
 # Clang is the default compiler on these architectures (see src/share/mk/bsd.own.mk)
 clang_cpus	:= i386 amd64 arm
 
@@ -95,7 +104,9 @@
 get-orig-source:
 	rm -rf $(ORIG_DIR)
 	svn export --ignore-keywords -r $(svn_revision) $(SVN)/sys $(ORIG_DIR)/sys
+ifeq ($(dfsg), true)
 	cd $(ORIG_DIR) && $(CURDIR)/debian/prune.sh
+endif
 	# Create tarball with files sorted in a stable order, see
 	# https://wiki.debian.org/ReproducibleBuilds/FileOrderInTarballs
 	find $(ORIG_DIR) -print0 | LC_ALL=C sort -z \
@@ -193,6 +204,17 @@
 	 \( -name Makefile -o -name Makefile.inc \) \
 	 -exec sed -i 's@$${.CURDIR}/@@g' \{\} \;
 
+ifneq ($(dfsg), true)
+	find $(FLAVOR_DIR)-$*/sys/modules/ \
+	 \( -name Makefile -o -name Makefile.inc \) \
+	 -exec sed -i 's/uudecode -p/uudecode -o -/' \{\} \;
+endif
+
+ifeq ($(dfsg), true)
+	cp debian/local/ar9300_devid.h $(FLAVOR_DIR)-$*/sys/contrib/dev/ath/ath_hal/ar9300/
+	cp debian/local/ar9300_devid.h $(FLAVOR_DIR)-$*/sys/dev/ath/ath_hal/ar9003/
+endif
+
 	touch $@
 build-flavor-%-stamp: src-flavor-%-stamp
 	# Add the abiname and the flavor to the kernel version
@@ -214,8 +236,10 @@
 	$(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)
+	cp debian/arch/$(cpu)/$*.config $(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/conf/$(configfile)
+ifeq ($(dfsg), true)
+	echo "include WITHOUT_SOURCELESS" >> $(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/conf/$(configfile)
+endif
 	cd $(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/conf \
 		&& config $(configfile)
 
@@ -275,7 +299,7 @@
 
 	# install the config file
 	install -o root -g root -m 644 \
-		$(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/conf/$*.config \
+		$(FLAVOR_DIR)-$*/sys/$(kfreebsd_cpu)/conf/$(configfile) \
 		$(IMAGE_PACKAGE)-$*/boot/config-$(version)-$(abiname)-$*
 
 	# now install the kernel

Reply to: