Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] svn commit: trunk/buildroot/package:  alsa-lib
@ 2007-07-23  7:54 ulf at uclibc.org
  2007-07-23 10:33 ` Bernhard Fischer
  0 siblings, 1 reply; 9+ messages in thread
From: ulf at uclibc.org @ 2007-07-23  7:54 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2007-07-23 00:54:13 -0700 (Mon, 23 Jul 2007)
New Revision: 19196

Log:
Add alsa-lib package

Added:
   trunk/buildroot/package/alsa-lib/
   trunk/buildroot/package/alsa-lib/Config.in
   trunk/buildroot/package/alsa-lib/alsa-lib.mk

Modified:
   trunk/buildroot/package/Config.in


Changeset:
Modified: trunk/buildroot/package/Config.in
===================================================================
--- trunk/buildroot/package/Config.in	2007-07-22 20:09:54 UTC (rev 19195)
+++ trunk/buildroot/package/Config.in	2007-07-23 07:54:13 UTC (rev 19196)
@@ -246,6 +246,7 @@
 	  Support for audio libraries and applications
 
 if BR2_AUDIO_SUPPORT
+source "package/alsa-lib/Config.in"
 source "package/asterisk/Config.in"
 source "package/aumix/Config.in"
 source "package/libid3tag/Config.in"

Added: trunk/buildroot/package/alsa-lib/Config.in
===================================================================
--- trunk/buildroot/package/alsa-lib/Config.in	                        (rev 0)
+++ trunk/buildroot/package/alsa-lib/Config.in	2007-07-23 07:54:13 UTC (rev 19196)
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_ALSA_LIB
+	bool "alsa-lib"
+	default n
+	help
+	  The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI
+	  functionality to the Linux operating system.
+
+	  http://www.alsa-project.org/

Added: trunk/buildroot/package/alsa-lib/alsa-lib.mk
===================================================================
--- trunk/buildroot/package/alsa-lib/alsa-lib.mk	                        (rev 0)
+++ trunk/buildroot/package/alsa-lib/alsa-lib.mk	2007-07-23 07:54:13 UTC (rev 19196)
@@ -0,0 +1,74 @@
+#############################################################
+#
+# alsa-lib
+#
+#############################################################
+ALSA_LIB_VER:=1.0.14a
+ALSA_LIB_SOURCE:=alsa-lib-$(ALSA_LIB_VER).tar.bz2
+ALSA_LIB_SITE:=ftp://ftp.alsa-project.org/pub/lib
+ALSA_LIB_DIR:=$(BUILD_DIR)/alsa-lib-$(ALSA_LIB_VER)
+ALSA_LIB_CAT:=$(BZCAT)
+ALSA_LIB_BINARY:=libasound.so.2.0.0
+ALSA_LIB_TARGET_BINARY:=usr/lib/$(ALSA_LIB_BINARY)
+
+$(DL_DIR)/$(ALSA_LIB_SOURCE):
+	$(WGET) -P $(DL_DIR) $(ALSA_LIB_SITE)/$(ALSA_LIB_SOURCE)
+
+$(ALSA_LIB_DIR)/.unpacked: $(DL_DIR)/$(ALSA_LIB_SOURCE)
+	$(ALSA_LIB_CAT) $(DL_DIR)/$(ALSA_LIB_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+	toolchain/patch-kernel.sh $(ALSA_LIB_DIR) package/alsa-lib/ alsa-lib-$(ALSA_LIB_VER)\*.patch*
+	$(CONFIG_UPDATE) $(ALSA_LIB_DIR)
+	@touch $@
+
+$(ALSA_LIB_DIR)/.configured: $(ALSA_LIB_DIR)/.unpacked
+	(cd $(ALSA_LIB_DIR); rm -rf config.cache; \
+		$(TARGET_CONFIGURE_OPTS) \
+		CFLAGS="$(TARGET_CFLAGS)" \
+		LDFLAGS="$(TARGET_LDFLAGS)" \
+		./configure \
+		--target=$(GNU_TARGET_NAME) \
+		--host=$(GNU_TARGET_NAME) \
+		--build=$(GNU_HOST_NAME) \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--enable-shared \
+		--enable-static \
+		--disable-docs \
+		$(DISABLE_NLS) \
+	);
+	@touch $@
+
+$(ALSA_LIB_DIR)/src/.libs/$(ALSA_LIB_BINARY): $(ALSA_LIB_DIR)/.configured
+	$(MAKE) -C $(ALSA_LIB_DIR)
+	@touch -c $@
+
+$(STAGING_DIR)/$(ALSA_LIB_TARGET_BINARY): $(ALSA_LIB_DIR)/src/.libs/$(ALSA_LIB_BINARY)
+	$(MAKE) DESTDIR=$(STAGING_DIR) -C $(ALSA_LIB_DIR) install
+	@touch -c $@
+
+$(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY): $(STAGING_DIR)/$(ALSA_LIB_TARGET_BINARY)
+	@mkdir -p $(TARGET_DIR)/usr/share/alsa
+	@mkdir -p $(TARGET_DIR)/usr/lib/alsa-lib
+	cp -dpf  $(STAGING_DIR)/lib/libasound.so*  $(TARGET_DIR)/usr/lib/
+	cp -rdpf $(STAGING_DIR)/usr/share/alsa/*   $(TARGET_DIR)/usr/share/alsa/
+	cp -rdpf $(STAGING_DIR)/usr/lib/alsa-lib/* $(TARGET_DIR)/usr/lib/alsa-lib/
+	-$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libasound.so*
+	-$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/alsa-lib/*.so
+	@touch -c $@
+
+alsa-lib: linux26 uclibc $(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY)
+
+alsa-lib-clean:
+	rm -f $(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY)
+	-$(MAKE) -C $(ALSA_LIB_DIR) clean
+
+alsa-lib-dirclean:
+	rm -rf $(ALSA_LIB_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_ALSA_LIB)),y)
+TARGETS+=alsa-lib
+endif

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/package:  alsa-lib
  2007-07-23  7:54 [Buildroot] svn commit: trunk/buildroot/package: alsa-lib ulf at uclibc.org
@ 2007-07-23 10:33 ` Bernhard Fischer
  2007-07-23 13:18   ` Ulf Samuelsson
  0 siblings, 1 reply; 9+ messages in thread
From: Bernhard Fischer @ 2007-07-23 10:33 UTC (permalink / raw)
  To: buildroot

On Mon, Jul 23, 2007 at 12:54:15AM -0700, ulf at uclibc.org wrote:
>Author: ulf
>Date: 2007-07-23 00:54:13 -0700 (Mon, 23 Jul 2007)
>New Revision: 19196
>
>Log:
>Add alsa-lib package
>
>Added:
>   trunk/buildroot/package/alsa-lib/
>   trunk/buildroot/package/alsa-lib/Config.in
>   trunk/buildroot/package/alsa-lib/alsa-lib.mk
>
>Modified:
>   trunk/buildroot/package/Config.in
>
>
>Changeset:
>Modified: trunk/buildroot/package/Config.in
>===================================================================
>--- trunk/buildroot/package/Config.in	2007-07-22 20:09:54 UTC (rev 19195)
>+++ trunk/buildroot/package/Config.in	2007-07-23 07:54:13 UTC (rev 19196)
>@@ -246,6 +246,7 @@
> 	  Support for audio libraries and applications
> 
> if BR2_AUDIO_SUPPORT
>+source "package/alsa-lib/Config.in"
> source "package/asterisk/Config.in"
> source "package/aumix/Config.in"
> source "package/libid3tag/Config.in"
>
>Added: trunk/buildroot/package/alsa-lib/Config.in
>===================================================================
>--- trunk/buildroot/package/alsa-lib/Config.in	                        (rev 0)
>+++ trunk/buildroot/package/alsa-lib/Config.in	2007-07-23 07:54:13 UTC (rev 19196)
>@@ -0,0 +1,8 @@
>+config BR2_PACKAGE_ALSA_LIB
>+	bool "alsa-lib"
>+	default n
>+	help
>+	  The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI
>+	  functionality to the Linux operating system.
>+
>+	  http://www.alsa-project.org/
>
>Added: trunk/buildroot/package/alsa-lib/alsa-lib.mk
>===================================================================
>--- trunk/buildroot/package/alsa-lib/alsa-lib.mk	                        (rev 0)
>+++ trunk/buildroot/package/alsa-lib/alsa-lib.mk	2007-07-23 07:54:13 UTC (rev 19196)
>@@ -0,0 +1,74 @@
>+#############################################################
>+#
>+# alsa-lib
>+#
>+#############################################################
>+ALSA_LIB_VER:=1.0.14a
>+ALSA_LIB_SOURCE:=alsa-lib-$(ALSA_LIB_VER).tar.bz2
>+ALSA_LIB_SITE:=ftp://ftp.alsa-project.org/pub/lib
>+ALSA_LIB_DIR:=$(BUILD_DIR)/alsa-lib-$(ALSA_LIB_VER)
>+ALSA_LIB_CAT:=$(BZCAT)
>+ALSA_LIB_BINARY:=libasound.so.2.0.0
>+ALSA_LIB_TARGET_BINARY:=usr/lib/$(ALSA_LIB_BINARY)
>+
>+$(DL_DIR)/$(ALSA_LIB_SOURCE):
>+	$(WGET) -P $(DL_DIR) $(ALSA_LIB_SITE)/$(ALSA_LIB_SOURCE)
>+
>+$(ALSA_LIB_DIR)/.unpacked: $(DL_DIR)/$(ALSA_LIB_SOURCE)
>+	$(ALSA_LIB_CAT) $(DL_DIR)/$(ALSA_LIB_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
>+	toolchain/patch-kernel.sh $(ALSA_LIB_DIR) package/alsa-lib/ alsa-lib-$(ALSA_LIB_VER)\*.patch*
>+	$(CONFIG_UPDATE) $(ALSA_LIB_DIR)
>+	@touch $@
>+
>+$(ALSA_LIB_DIR)/.configured: $(ALSA_LIB_DIR)/.unpacked
>+	(cd $(ALSA_LIB_DIR); rm -rf config.cache; \
>+		$(TARGET_CONFIGURE_OPTS) \
>+		CFLAGS="$(TARGET_CFLAGS)" \
>+		LDFLAGS="$(TARGET_LDFLAGS)" \

NO!

You forgot to pass TARGET_CONFIGURE_ARGS
>+		./configure \
>+		--target=$(GNU_TARGET_NAME) \
>+		--host=$(GNU_TARGET_NAME) \
>+		--build=$(GNU_HOST_NAME) \
>+		--prefix=/usr \
>+		--sysconfdir=/etc \
>+		--enable-shared \
>+		--enable-static \
>+		--disable-docs \
>+		$(DISABLE_NLS) \
>+	);
>+	@touch $@

I object to hide such trivia away.

>+
>+$(ALSA_LIB_DIR)/src/.libs/$(ALSA_LIB_BINARY): $(ALSA_LIB_DIR)/.configured
>+	$(MAKE) -C $(ALSA_LIB_DIR)
>+	@touch -c $@
>+
>+$(STAGING_DIR)/$(ALSA_LIB_TARGET_BINARY): $(ALSA_LIB_DIR)/src/.libs/$(ALSA_LIB_BINARY)
>+	$(MAKE) DESTDIR=$(STAGING_DIR) -C $(ALSA_LIB_DIR) install
>+	@touch -c $@
>+
>+$(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY): $(STAGING_DIR)/$(ALSA_LIB_TARGET_BINARY)
>+	@mkdir -p $(TARGET_DIR)/usr/share/alsa
>+	@mkdir -p $(TARGET_DIR)/usr/lib/alsa-lib
>+	cp -dpf  $(STAGING_DIR)/lib/libasound.so*  $(TARGET_DIR)/usr/lib/
>+	cp -rdpf $(STAGING_DIR)/usr/share/alsa/*   $(TARGET_DIR)/usr/share/alsa/
>+	cp -rdpf $(STAGING_DIR)/usr/lib/alsa-lib/* $(TARGET_DIR)/usr/lib/alsa-lib/

install(1) would be cleaner, especially if you consider that it's a new
package.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/package:  alsa-lib
  2007-07-23 10:33 ` Bernhard Fischer
@ 2007-07-23 13:18   ` Ulf Samuelsson
  2007-07-23 13:34     ` Bernhard Fischer
  0 siblings, 1 reply; 9+ messages in thread
From: Ulf Samuelsson @ 2007-07-23 13:18 UTC (permalink / raw)
  To: buildroot


>+$(ALSA_LIB_DIR)/src/.libs/$(ALSA_LIB_BINARY): $(ALSA_LIB_DIR)/.configured
> >+	$(MAKE) -C $(ALSA_LIB_DIR)
> >+	@touch -c $@
> >+
> >+$(STAGING_DIR)/$(ALSA_LIB_TARGET_BINARY): $(ALSA_LIB_DIR)/src/.libs/$(ALSA_LIB_BINARY)
> >+	$(MAKE) DESTDIR=$(STAGING_DIR) -C $(ALSA_LIB_DIR) install
> >+	@touch -c $@
> >+
> >+$(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY): $(STAGING_DIR)/$(ALSA_LIB_TARGET_BINARY)
> >+	@mkdir -p $(TARGET_DIR)/usr/share/alsa
> >+	@mkdir -p $(TARGET_DIR)/usr/lib/alsa-lib
> >+	cp -dpf  $(STAGING_DIR)/lib/libasound.so*  $(TARGET_DIR)/usr/lib/
> >+	cp -rdpf $(STAGING_DIR)/usr/share/alsa/*   $(TARGET_DIR)/usr/share/alsa/
> >+	cp -rdpf $(STAGING_DIR)/usr/lib/alsa-lib/* $(TARGET_DIR)/usr/lib/alsa-lib/
> 
> install(1) would be cleaner, especially if you consider that it's a new
> package.

make install is done on the staging dir.
I think the reason for not doing make install on the target dir is
that it will add a lot of other stuff which is not wanted on an embedded
system.
It is a matter of taste if you "install and remove", or just copy
the *needed* stuff. 
Have to discuss with Someone Else(tm) if you insist.

> _______________________________________________
> buildroot mailing list
> buildroot at uclibc.org
> http://busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/package:  alsa-lib
  2007-07-23 13:18   ` Ulf Samuelsson
@ 2007-07-23 13:34     ` Bernhard Fischer
  2007-07-23 14:42       ` Ulf Samuelsson
                         ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Bernhard Fischer @ 2007-07-23 13:34 UTC (permalink / raw)
  To: buildroot

On Mon, Jul 23, 2007 at 03:18:05PM +0200, Ulf Samuelsson wrote:
>
>>+$(ALSA_LIB_DIR)/src/.libs/$(ALSA_LIB_BINARY): $(ALSA_LIB_DIR)/.configured
>> >+	$(MAKE) -C $(ALSA_LIB_DIR)
>> >+	@touch -c $@
>> >+
>> >+$(STAGING_DIR)/$(ALSA_LIB_TARGET_BINARY): $(ALSA_LIB_DIR)/src/.libs/$(ALSA_LIB_BINARY)
>> >+	$(MAKE) DESTDIR=$(STAGING_DIR) -C $(ALSA_LIB_DIR) install
>> >+	@touch -c $@
>> >+
>> >+$(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY): $(STAGING_DIR)/$(ALSA_LIB_TARGET_BINARY)
>> >+	@mkdir -p $(TARGET_DIR)/usr/share/alsa
>> >+	@mkdir -p $(TARGET_DIR)/usr/lib/alsa-lib
>> >+	cp -dpf  $(STAGING_DIR)/lib/libasound.so*  $(TARGET_DIR)/usr/lib/
>> >+	cp -rdpf $(STAGING_DIR)/usr/share/alsa/*   $(TARGET_DIR)/usr/share/alsa/
>> >+	cp -rdpf $(STAGING_DIR)/usr/lib/alsa-lib/* $(TARGET_DIR)/usr/lib/alsa-lib/
>> 
>> install(1) would be cleaner, especially if you consider that it's a new
>> package.
>
>make install is done on the staging dir.

make install != install(1)
man install
$(INSTALL) -D /thisfile /thatfile /there/newdir
or something like that.

>I think the reason for not doing make install on the target dir is
>that it will add a lot of other stuff which is not wanted on an embedded
>system.

This is unrelated but true, yes :)

>It is a matter of taste if you "install and remove", or just copy
>the *needed* stuff. 

I prefer to just copy the needed stuff.

>Have to discuss with Someone Else(tm) if you insist.

Just using install(1) for new packages -- and eventually gradually
fixing old ones -- is sufficient. We can easily either use busybox's
install or have our own in buildroot to circumvent eventual buggy
incarnations on the host. This would also help the MacOS10 folks, i'd
say.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/package:  alsa-lib
  2007-07-23 13:34     ` Bernhard Fischer
@ 2007-07-23 14:42       ` Ulf Samuelsson
  2007-07-26  7:01       ` Hans-Christian Egtvedt
       [not found]       ` <1185429498.31437.11.camel@localhost.localdomain>
  2 siblings, 0 replies; 9+ messages in thread
From: Ulf Samuelsson @ 2007-07-23 14:42 UTC (permalink / raw)
  To: buildroot


> >
> >make install is done on the staging dir.
> 
> make install != install(1)
> man install
> $(INSTALL) -D /thisfile /thatfile /there/newdir
> or something like that.
> 
> >I think the reason for not doing make install on the target dir is
> >that it will add a lot of other stuff which is not wanted on an embedded
> >system.
> 
> This is unrelated but true, yes :)
> 
> >It is a matter of taste if you "install and remove", or just copy
> >the *needed* stuff. 
> 
> I prefer to just copy the needed stuff.
> 
> >Have to discuss with Someone Else(tm) if you insist.
> 
> Just using install(1) for new packages -- and eventually gradually
> fixing old ones -- is sufficient. We can easily either use busybox's
> install or have our own in buildroot to circumvent eventual buggy
> incarnations on the host. This would also help the MacOS10 folks, i'd
> say.

OK, I'll look into it, but I guess the x86 test will take priority for
the moment...

Best Regards
Ulf Samuelsson

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/package:  alsa-lib
  2007-07-23 13:34     ` Bernhard Fischer
  2007-07-23 14:42       ` Ulf Samuelsson
@ 2007-07-26  7:01       ` Hans-Christian Egtvedt
       [not found]       ` <1185429498.31437.11.camel@localhost.localdomain>
  2 siblings, 0 replies; 9+ messages in thread
From: Hans-Christian Egtvedt @ 2007-07-26  7:01 UTC (permalink / raw)
  To: buildroot

On Mon, 2007-07-23 at 15:34 +0200, Bernhard Fischer wrote:
> On Mon, Jul 23, 2007 at 03:18:05PM +0200, Ulf Samuelsson wrote:

<cut alsa-lib patch and use of install instead of cp>

> Just using install(1) for new packages -- and eventually gradually
> fixing old ones -- is sufficient. We can easily either use busybox's
> install or have our own in buildroot to circumvent eventual buggy
> incarnations on the host. This would also help the MacOS10 folks, i'd
> say.

FYI

IIRC the install shipped with buildroot is buggy (they might have fixed
it). It had a bug when it would not unlink the old file before writing
the new.

Pretty funny trying to upgrade libc then; Busybox would truncate the
file to 0 bytes and then try to copy in the new one, never being able to
complete that job because of missing libc.

-- 
With kind regards,

Hans-Christian Egtvedt, siv.ing. (M.Sc.)
Applications Engineer - AVR32 System Solutions - Atmel Norway
-- 
Mvh
Hans-Christian Egtvedt

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/package:  alsa-lib
       [not found]       ` <1185429498.31437.11.camel@localhost.localdomain>
@ 2007-07-27 15:59         ` Bernhard Fischer
  2007-08-20  8:34           ` [Buildroot] [RFC] Building linux kernel in $(PROJECT_BUILD_DIR) Ulf Samuelsson
  0 siblings, 1 reply; 9+ messages in thread
From: Bernhard Fischer @ 2007-07-27 15:59 UTC (permalink / raw)
  To: buildroot

On Thu, Jul 26, 2007 at 07:58:18AM +0200, Hans-Christian Egtvedt wrote:
>
>On Mon, 2007-07-23 at 15:34 +0200, Bernhard Fischer wrote:
>> On Mon, Jul 23, 2007 at 03:18:05PM +0200, Ulf Samuelsson wrote:
>
><cut alsa-lib patch and use of install instead of cp>
>
>> Just using install(1) for new packages -- and eventually gradually
>> fixing old ones -- is sufficient. We can easily either use busybox's
>> install or have our own in buildroot to circumvent eventual buggy
>> incarnations on the host. This would also help the MacOS10 folks, i'd
>> say.
>
>FYI
>
>IIRC the install shipped with buildroot is buggy (they might have fixed
>it). It had a bug when it would not unlink the old file before writing
>the new.

$ echo BAR > foo
$ echo FOO > new
$ ./busybox install new foo
[]
open("new", O_RDONLY)                   = 3
open("foo", O_WRONLY|O_CREAT|O_EXCL, 0100644) = -1 EEXIST (File exists)
unlink("foo")                           = 0
open("foo", O_WRONLY|O_CREAT|O_EXCL, 0100644) = 4
read(3, "FOO\n", 8192)                  = 4
write(4, "FOO\n", 4)                    = 4
read(3, "", 8192)                       = 0
close(4)                                = 0
close(3)                                = 0

So it looks like "they" fixed it.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [RFC] Building linux kernel in $(PROJECT_BUILD_DIR)
  2007-07-27 15:59         ` Bernhard Fischer
@ 2007-08-20  8:34           ` Ulf Samuelsson
  2007-08-20 15:56             ` Bernhard Fischer
  0 siblings, 1 reply; 9+ messages in thread
From: Ulf Samuelsson @ 2007-08-20  8:34 UTC (permalink / raw)
  To: buildroot

Proposed fix to allow each project to build its own linux kernel
in $(PROJECT_BUILD_DIR)  == project_build_dir/<project>

Basic approach is to unpack the linux header source in 
"$(TOOL_BUILD_DIR)" instead of in "$(BUILD_DIR)"
Patches are applied (some depending on BR2_<xxx>) as in current trunk,

Each board can add additional patches by defining
KERNEL_HEADERS_PATCH_DIR to point at the directory with additional
patches (That patch just applied to get rid of AVR32 patches in 
toolchain/kernel-headers).

Headers are still installed in "$(TOOL_BUILD_DIR)/linux"
The kernel-headers source tree is unpacked once per toolchain.

The target/linux build (modules and kernel) will unpack a 
second linux source tree in "$(PROJECT_BUILD_DIR)".
This source tree is generated once per *project*.

Since this is a fresh unpack, the same patches as were applied
to the kernel-headers are applied to "$(PROJECT_BUILD_DIR)/linux-*".

A common linux source tree for all projects is not possible, since
different boards can require different patches to be applied.
There is a significant risk that the linux build breaks if patches for
one project are applied on top of patches for another project
in the same source tree.

With a single source, you therefore will have to remove the linux source
tree each time you work on a new project.
With a separate source, you can move between projects without removing
the linux source directory.


The patch is also include it as an attachement, due to linewrap.

Tested this on x86/Atmel targets.

Comments?


Index: toolchain/kernel-headers/kernel-headers-new.makefile
===================================================================
--- toolchain/kernel-headers/kernel-headers-new.makefile	(revision
19588)
+++ toolchain/kernel-headers/kernel-headers-new.makefile	(arbetskopia)
@@ -13,7 +13,7 @@
 LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
 LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
 LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
+LINUX_HEADERS_UNPACK_DIR:=
$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
 LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
 LINUX_HEADERS_IS_KERNEL=y
 endif
@@ -28,7 +28,7 @@
 LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
 LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
 LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
+LINUX_HEADERS_UNPACK_DIR:=
$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
 LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
 LINUX_HEADERS_IS_KERNEL=y
 endif
@@ -43,7 +43,7 @@
 LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
 LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
 LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
+LINUX_HEADERS_UNPACK_DIR:=
$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
 LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
 LINUX_HEADERS_IS_KERNEL=y
 endif
@@ -56,8 +56,8 @@
 $(LINUX_HEADERS_UNPACK_DIR)/.unpacked:
$(DL_DIR)/$(LINUX_HEADERS_SOURCE)
 	@echo "*** Using kernel-headers generated from kernel source"
 	rm -rf $(LINUX_HEADERS_DIR)
-	[ -d $(BUILD_DIR) ] || $(INSTALL) -d $(BUILD_DIR)
-	$(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C
$(BUILD_DIR) $(TAR_OPTIONS) -
+	[ -d $(TOOL_BUILD_DIR) ] || $(INSTALL) -d $(TOOL_BUILD_DIR)
+	$(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C
$(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
 	touch $@
 
 $(LINUX_HEADERS_UNPACK_DIR)/.patched:
$(LINUX_HEADERS_UNPACK_DIR)/.unpacked
Index: toolchain/kernel-headers/kernel-headers.mk
===================================================================
--- toolchain/kernel-headers/kernel-headers.mk	(revision 19588)
+++ toolchain/kernel-headers/kernel-headers.mk	(arbetskopia)
@@ -37,5 +37,6 @@
 
 kernel-headers-dirclean:
 	rm -rf $(LINUX_HEADERS_DIR)
+	rm -rf $(LINUX_HEADERS_UNPACK_DIR)
 
 .PHONY: kernel-headers
Index: target/linux/Makefile.in
===================================================================
--- target/linux/Makefile.in	(revision 19588)
+++ target/linux/Makefile.in	(arbetskopia)
@@ -68,7 +68,7 @@
 endif
 
 # Version of Linux AFTER patches
-LINUX26_DIR=$(BUILD_DIR)/linux-$(LINUX26_VERSION)
+LINUX26_DIR=$(PROJECT_BUILD_DIR)/linux-$(LINUX26_VERSION)
 
 # for packages that need it
 LINUX_VERSION:=$(LINUX_VERSION)
@@ -76,7 +76,9 @@
 LINUX_KERNEL=$(LINUX26_KERNEL)
 
 # kernel patches
+ifeq ($(strip $(LINUX26_PATCH_DIR)),)
 LINUX26_PATCH_DIR=$(BR2_BOARD_PATH)/kernel-patches/
+endif
 __LINUX26_NO_PIC=-fPIC -fpic -DPIC
 LINUX26_MAKE_FLAGS = HOSTCC="$(HOSTCC)" HOSTCFLAGS=$(HOSTCFLAGS) \
 	ARCH=$(KERNEL_ARCH) \
@@ -96,20 +98,38 @@
 ifneq ($(strip $(LINUX26_VERSION)),$(strip $(LINUX_HEADERS_VERSION)))
 $(DL_DIR)/$(LINUX26_SOURCE):
 	 $(WGET) -P $(DL_DIR) $(LINUX26_SITE)/$(LINUX26_SOURCE)
+endif # ($(LINUX26_VERSION),$(LINUX_HEADERS_VERSION))
 
 $(LINUX26_DIR)/.unpacked: $(DL_DIR)/$(LINUX26_SOURCE)
 	rm -rf $(LINUX26_DIR)
-	$(LINUX26_BZCAT) $(DL_DIR)/$(LINUX26_SOURCE) | tar -C $(BUILD_DIR)
$(TAR_OPTIONS) -
+	$(LINUX26_BZCAT) $(DL_DIR)/$(LINUX26_SOURCE) | tar -C
$(PROJECT_BUILD_DIR) $(TAR_OPTIONS) -
 ifneq ($(DOWNLOAD_LINUX26_VERSION),$(LINUX26_VERSION))
 	# Rename the dir from the downloaded version to the AFTER patch
version
-	mv -f $(BUILD_DIR)/linux-$(DOWNLOAD_LINUX26_VERSION) $(LINUX26_DIR)
+	mv -f $(PROJECT_BUILD_DIR)/linux-$(DOWNLOAD_LINUX26_VERSION)
$(LINUX26_DIR)
 endif
 	touch $@
 
 $(LINUX26_DIR)/.patched: $(LINUX26_DIR)/.unpacked
-	toolchain/patch-kernel.sh $(LINUX26_DIR) $(LINUX26_PATCH_DIR) \*.patch
+	toolchain/patch-kernel.sh $(LINUX26_DIR) toolchain/kernel-headers \
+		linux-$(LINUX26_VERSION)-\*.patch{,.gz,.bz2}
+ifeq ($(BR2_KERNEL_HEADERS_IPMI),y)
+	toolchain/patch-kernel.sh $(LINUX26_DIR) toolchain/kernel-headers/ipmi
\
+		linux-$(LINUX26_VERSION)-\*.patch{,.gz,.bz2}
+endif
+ifeq ($(BR2_KERNEL_HEADERS_LZMA),y)
+	toolchain/patch-kernel.sh $(LINUX26_DIR) toolchain/kernel-headers/lzma
\
+		linux-$(LINUX26_VERSION)-\*.patch{,.gz,.bz2}
+endif
+ifeq ($(BR2_KERNEL_HEADERS_PATCH_DIR),y)
+	toolchain/patch-kernel.sh $(LINUX26_DIR) $(KERNEL_HEADERS_PATCH_DIR) \
+		linux-$(LINUX26_VERSION)-\*.patch{,.gz,.bz2}
+endif
+ifeq ($(BR2_PACKAGE_OPENSWAN),y)
+	toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) package/openswan
\
+		linux-$(LINUX26_VERSION)-\*.patch{,.gz,.bz2}
+endif
+	toolchain/patch-kernel.sh $(LINUX26_DIR) $(LINUX26_PATCH_DIR)
linux-$(LINUX26_VERSION)\*.patch
 	touch $@
-endif # ($(LINUX26_VERSION),$(LINUX_HEADERS_VERSION))
 
 $(LINUX26_DIR)/.configured: $(LINUX26_DIR)/.patched $(LINUX26_KCONFIG)
 	cp -dpf $(LINUX26_KCONFIG) $(LINUX26_DIR)/.config


Best Regards
Ulf Samuelsson

-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux-bsp.patch
Type: text/x-patch
Size: 5155 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20070820/f89b5bb9/attachment-0001.bin 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [RFC] Building linux kernel in $(PROJECT_BUILD_DIR)
  2007-08-20  8:34           ` [Buildroot] [RFC] Building linux kernel in $(PROJECT_BUILD_DIR) Ulf Samuelsson
@ 2007-08-20 15:56             ` Bernhard Fischer
  0 siblings, 0 replies; 9+ messages in thread
From: Bernhard Fischer @ 2007-08-20 15:56 UTC (permalink / raw)
  To: buildroot

On Mon, Aug 20, 2007 at 10:34:50AM +0200, Ulf Samuelsson wrote:
>Proposed fix to allow each project to build its own linux kernel
>in $(PROJECT_BUILD_DIR)  == project_build_dir/<project>
>
>Basic approach is to unpack the linux header source in 
>"$(TOOL_BUILD_DIR)" instead of in "$(BUILD_DIR)"
>Patches are applied (some depending on BR2_<xxx>) as in current trunk,
>
>Each board can add additional patches by defining
>KERNEL_HEADERS_PATCH_DIR to point at the directory with additional
>patches (That patch just applied to get rid of AVR32 patches in 
>toolchain/kernel-headers).
>
>Headers are still installed in "$(TOOL_BUILD_DIR)/linux"
>The kernel-headers source tree is unpacked once per toolchain.
>
>The target/linux build (modules and kernel) will unpack a 
>second linux source tree in "$(PROJECT_BUILD_DIR)".
>This source tree is generated once per *project*.
>
>Since this is a fresh unpack, the same patches as were applied
>to the kernel-headers are applied to "$(PROJECT_BUILD_DIR)/linux-*".
>
>A common linux source tree for all projects is not possible, since
>different boards can require different patches to be applied.
>There is a significant risk that the linux build breaks if patches for
>one project are applied on top of patches for another project
>in the same source tree.
>
>With a single source, you therefore will have to remove the linux source
>tree each time you work on a new project.
>With a separate source, you can move between projects without removing
>the linux source directory.
>
>
>The patch is also include it as an attachement, due to linewrap.
>
>Tested this on x86/Atmel targets.
>
>Comments?
>
>
>Index: toolchain/kernel-headers/kernel-headers-new.makefile
>===================================================================
>--- toolchain/kernel-headers/kernel-headers-new.makefile	(revision
>19588)
>+++ toolchain/kernel-headers/kernel-headers-new.makefile	(arbetskopia)
>@@ -13,7 +13,7 @@
> LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
> LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
> LINUX_HEADERS_CAT:=$(BZCAT)
>-LINUX_HEADERS_UNPACK_DIR:=$(BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
>+LINUX_HEADERS_UNPACK_DIR:=
>$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
> LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
> LINUX_HEADERS_IS_KERNEL=y
> endif
>@@ -28,7 +28,7 @@
> LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
> LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
> LINUX_HEADERS_CAT:=$(BZCAT)
>-LINUX_HEADERS_UNPACK_DIR:=$(BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
>+LINUX_HEADERS_UNPACK_DIR:=
>$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
> LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
> LINUX_HEADERS_IS_KERNEL=y
> endif
>@@ -43,7 +43,7 @@
> LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
> LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
> LINUX_HEADERS_CAT:=$(BZCAT)
>-LINUX_HEADERS_UNPACK_DIR:=$(BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
>+LINUX_HEADERS_UNPACK_DIR:=
>$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
> LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
> LINUX_HEADERS_IS_KERNEL=y
> endif
>@@ -56,8 +56,8 @@
> $(LINUX_HEADERS_UNPACK_DIR)/.unpacked:
>$(DL_DIR)/$(LINUX_HEADERS_SOURCE)
> 	@echo "*** Using kernel-headers generated from kernel source"
> 	rm -rf $(LINUX_HEADERS_DIR)
>-	[ -d $(BUILD_DIR) ] || $(INSTALL) -d $(BUILD_DIR)
>-	$(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C
>$(BUILD_DIR) $(TAR_OPTIONS) -
>+	[ -d $(TOOL_BUILD_DIR) ] || $(INSTALL) -d $(TOOL_BUILD_DIR)

I think that the TOOL_BUILD_DIR will already exist now.
To verify, set BR2_JLEVEL=1 and execute a toplevel
make -j 64
If it is not yet created at this stage, just adding a dependency to that
dir should be sufficient (we already have a rule for it, IIRC).

>+	$(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C
>$(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
> 	touch $@
> 
> $(LINUX_HEADERS_UNPACK_DIR)/.patched:
>$(LINUX_HEADERS_UNPACK_DIR)/.unpacked
>Index: toolchain/kernel-headers/kernel-headers.mk
>===================================================================
>--- toolchain/kernel-headers/kernel-headers.mk	(revision 19588)
>+++ toolchain/kernel-headers/kernel-headers.mk	(arbetskopia)
>@@ -37,5 +37,6 @@
> 
> kernel-headers-dirclean:
> 	rm -rf $(LINUX_HEADERS_DIR)
>+	rm -rf $(LINUX_HEADERS_UNPACK_DIR)
> 
> .PHONY: kernel-headers
>Index: target/linux/Makefile.in
>===================================================================
>--- target/linux/Makefile.in	(revision 19588)
>+++ target/linux/Makefile.in	(arbetskopia)
>@@ -68,7 +68,7 @@
> endif
> 
> # Version of Linux AFTER patches
>-LINUX26_DIR=$(BUILD_DIR)/linux-$(LINUX26_VERSION)
>+LINUX26_DIR=$(PROJECT_BUILD_DIR)/linux-$(LINUX26_VERSION)
> 
> # for packages that need it
> LINUX_VERSION:=$(LINUX_VERSION)
>@@ -76,7 +76,9 @@
> LINUX_KERNEL=$(LINUX26_KERNEL)
> 
> # kernel patches
>+ifeq ($(strip $(LINUX26_PATCH_DIR)),)
> LINUX26_PATCH_DIR=$(BR2_BOARD_PATH)/kernel-patches/
>+endif
> __LINUX26_NO_PIC=-fPIC -fpic -DPIC
> LINUX26_MAKE_FLAGS = HOSTCC="$(HOSTCC)" HOSTCFLAGS=$(HOSTCFLAGS) \
> 	ARCH=$(KERNEL_ARCH) \
>@@ -96,20 +98,38 @@
> ifneq ($(strip $(LINUX26_VERSION)),$(strip $(LINUX_HEADERS_VERSION)))
> $(DL_DIR)/$(LINUX26_SOURCE):
> 	 $(WGET) -P $(DL_DIR) $(LINUX26_SITE)/$(LINUX26_SOURCE)
>+endif # ($(LINUX26_VERSION),$(LINUX_HEADERS_VERSION))
> 
> $(LINUX26_DIR)/.unpacked: $(DL_DIR)/$(LINUX26_SOURCE)
> 	rm -rf $(LINUX26_DIR)
>-	$(LINUX26_BZCAT) $(DL_DIR)/$(LINUX26_SOURCE) | tar -C $(BUILD_DIR)
>$(TAR_OPTIONS) -
>+	$(LINUX26_BZCAT) $(DL_DIR)/$(LINUX26_SOURCE) | tar -C
>$(PROJECT_BUILD_DIR) $(TAR_OPTIONS) -
> ifneq ($(DOWNLOAD_LINUX26_VERSION),$(LINUX26_VERSION))
> 	# Rename the dir from the downloaded version to the AFTER patch
>version
>-	mv -f $(BUILD_DIR)/linux-$(DOWNLOAD_LINUX26_VERSION) $(LINUX26_DIR)
>+	mv -f $(PROJECT_BUILD_DIR)/linux-$(DOWNLOAD_LINUX26_VERSION)
>$(LINUX26_DIR)
> endif
> 	touch $@
> 
> $(LINUX26_DIR)/.patched: $(LINUX26_DIR)/.unpacked
>-	toolchain/patch-kernel.sh $(LINUX26_DIR) $(LINUX26_PATCH_DIR) \*.patch
>+	toolchain/patch-kernel.sh $(LINUX26_DIR) toolchain/kernel-headers \
>+		linux-$(LINUX26_VERSION)-\*.patch{,.gz,.bz2}
>+ifeq ($(BR2_KERNEL_HEADERS_IPMI),y)
>+	toolchain/patch-kernel.sh $(LINUX26_DIR) toolchain/kernel-headers/ipmi
>\
>+		linux-$(LINUX26_VERSION)-\*.patch{,.gz,.bz2}
>+endif
>+ifeq ($(BR2_KERNEL_HEADERS_LZMA),y)
>+	toolchain/patch-kernel.sh $(LINUX26_DIR) toolchain/kernel-headers/lzma
>\
>+		linux-$(LINUX26_VERSION)-\*.patch{,.gz,.bz2}
>+endif
>+ifeq ($(BR2_KERNEL_HEADERS_PATCH_DIR),y)
>+	toolchain/patch-kernel.sh $(LINUX26_DIR) $(KERNEL_HEADERS_PATCH_DIR) \
>+		linux-$(LINUX26_VERSION)-\*.patch{,.gz,.bz2}
>+endif
>+ifeq ($(BR2_PACKAGE_OPENSWAN),y)
>+	toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) package/openswan
>\
>+		linux-$(LINUX26_VERSION)-\*.patch{,.gz,.bz2}
>+endif
>+	toolchain/patch-kernel.sh $(LINUX26_DIR) $(LINUX26_PATCH_DIR)

Hardcoding these is very, very ugly.

>linux-$(LINUX26_VERSION)\*.patch
> 	touch $@
>-endif # ($(LINUX26_VERSION),$(LINUX_HEADERS_VERSION))
> 
> $(LINUX26_DIR)/.configured: $(LINUX26_DIR)/.patched $(LINUX26_KCONFIG)
> 	cp -dpf $(LINUX26_KCONFIG) $(LINUX26_DIR)/.config
>

Did you test this with the old, deprecated headers, with new headers ==
src and new-headers != src ?

If so, then please apply with abovementioned fix for the mkdir.

thanks,

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-08-20 15:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23  7:54 [Buildroot] svn commit: trunk/buildroot/package: alsa-lib ulf at uclibc.org
2007-07-23 10:33 ` Bernhard Fischer
2007-07-23 13:18   ` Ulf Samuelsson
2007-07-23 13:34     ` Bernhard Fischer
2007-07-23 14:42       ` Ulf Samuelsson
2007-07-26  7:01       ` Hans-Christian Egtvedt
     [not found]       ` <1185429498.31437.11.camel@localhost.localdomain>
2007-07-27 15:59         ` Bernhard Fischer
2007-08-20  8:34           ` [Buildroot] [RFC] Building linux kernel in $(PROJECT_BUILD_DIR) Ulf Samuelsson
2007-08-20 15:56             ` Bernhard Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox