Pull request for branch for-2011.02/boards-cleanup
Subsystems (2)
PATCH 55/55 linux: add KERNEL_ARCH_PATH to fix x86-specific issue
In reply to Thomas PetazzoniBoth i386 and x86_64 architectures are supported by the arch/x86 directory in the kernel. So, when we copy the kernel configuration file to arch/$(KERNEL_ARCH)/configs/, it does not work because arch/i386 and arch/x86_64 do not exist.
So, we introduce KERNEL_ARCH_PATH, which is the path to the architecture specific directory in the kernel source tree.
--- linux/linux.mk | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-)
linux/linux.mk +16 -4
@@ -44,13 +44,25 @@ else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y) LINUX26_IMAGE_NAME=vmlinux endif +# Compute the arch path, since i386 and x86_64 are in arch/x86 and not +# in arch/$(KERNEL_ARCH). Even if the kernel creates symbolic links +# for bzImage, arch/i386 and arch/x86_64 do not exist when copying the +# defconfig file. +ifeq ($(KERNEL_ARCH),i386) +KERNEL_ARCH_PATH=$(LINUX26_DIR)/arch/x86 +else ifeq ($(KERNEL_ARCH),x86_64) +KERNEL_ARCH_PATH=$(LINUX26_DIR)/arch/x86 +else +KERNEL_ARCH_PATH=$(LINUX26_DIR)/arch/$(KERNEL_ARCH) +endif + ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y) LINUX26_IMAGE_PATH=$(LINUX26_DIR)/$(LINUX26_IMAGE_NAME) else ifeq ($(KERNEL_ARCH),avr32) -LINUX26_IMAGE_PATH=$(LINUX26_DIR)/arch/$(KERNEL_ARCH)/boot/images/$(LINUX26_IMAGE_NAME) +LINUX26_IMAGE_PATH=$(KERNEL_ARCH_PATH)/boot/images/$(LINUX26_IMAGE_NAME) else -LINUX26_IMAGE_PATH=$(LINUX26_DIR)/arch/$(KERNEL_ARCH)/boot/$(LINUX26_IMAGE_NAME) +LINUX26_IMAGE_PATH=$(KERNEL_ARCH_PATH)/boot/$(LINUX26_IMAGE_NAME) endif endif # BR2_LINUX_KERNEL_VMLINUX
@@ -92,9 +104,9 @@ $(LINUX26_DIR)/.stamp_configured: $(LINUX26_DIR)/.stamp_patched ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y) $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX26_MAKE_FLAGS) -C $(@D) $(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y) - cp $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE) $(@D)/arch/$(KERNEL_ARCH)/configs/buildroot_defconfig + cp $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX26_MAKE_FLAGS) -C $(@D) buildroot_defconfig - rm $(@D)/arch/$(KERNEL_ARCH)/configs/buildroot_defconfig + rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig endif # Our fstab uses tmpfs $(call KCONFIG_ENABLE_OPT,CONFIG_TMPFS,$(@D)/.config)
Signature · 1 line
1.7.0.4
PATCH 50/55 xtensa: remove unused and useless skeleton patch
In reply to Thomas PetazzoniHi Thomas,
We're using this particular inittab for our boards. I realize I haven't sync'ed buildroot recently, but is there now a more appropriate way to do this, that makes this approach "useless" ?
Thanks!
-Marc
Quoted 56 lines · Thomas Petazzoni
Signed-off-by Thomas Petazzoni <[email protected]>--- target/device/xtensa/skeleton-patch/etc/inittab | 45----------------------- 1 files changed, 0 insertions(+), 45 deletions(-) delete mode 100644
target/device/xtensa/skeleton-patch/etc/inittabtarget/device/xtensa/skeleton-patch/etc/inittab deleted +0
-5--- a/target/device/xtensa/skeleton-patch/etc/inittab +++ /dev/null@@ -1,45 +0,0 @@ -# /etc/inittab -# -# Copyright (C) 2001 Erik Andersen <[email protected]> -# -# Note: BusyBox init doesn't support runlevels. Therunlevels field is
target/device/xtensa/skeleton-patch/etc/inittab deleted +0
-39-# completely ignored by BusyBox init. If you want runlevels, use -# sysvinit. -# -# Format for each entry: <id>:<runlevels>:<action>:<process> -# -# id == tty to run on, or empty for /dev/console -# runlevels == ignored -# action == one of sysinit, respawn, askfirst, wait, and once -# process == program to run - -# Startup the system -null::sysinit:/bin/mount -t proc proc /proc -null::sysinit:/bin/mount -o remount,rw / -null::sysinit:/bin/mount -a -null::sysinit:/bin/hostname -F /etc/hostname -# now run any rc scripts -::sysinit:/etc/init.d/rcS - -# Set up a couple of getty's -#tty1::respawn:/sbin/getty 38400 tty1 -#tty2::respawn:/sbin/getty 38400 tty2 - -# Put a getty on the serial port -ttyS0::respawn:/sbin/getty -L ttyS0 38400 vt100 - -# Logging junk -null::sysinit:/bin/touch /var/log/messages -null::respawn:/sbin/syslogd -n -m 0 -null::respawn:/sbin/klogd -n -#tty3::respawn:/usr/bin/tail -f /var/log/messages - -# Stuff to do for the 3-finger salute -::ctrlaltdel:/sbin/reboot - -# Stuff to do before rebooting -null::shutdown:/usr/bin/killall klogd -null::shutdown:/usr/bin/killall syslogd -null::shutdown:/bin/umount -a -r -null::shutdown:/sbin/swapoff -a -
PATCH 50/55 xtensa: remove unused and useless skeleton patch
In reply to Thomas PetazzoniQuoted 6 lines · Marc Gauthier
Hi Thomas,
We're using this particular inittab for our boards.
I realize I haven't sync'ed buildroot recently, but is there now a more appropriate way to do this, that makes this approach "useless" ?
Sorry, missed the associated pull request. Will reply to that.
-Marc
PATCH 9/55 Stop referencing the crazy target/device stuff
In reply to Thomas PetazzoniHi,
Quoted 3 lines · Thomas Petazzoni
We don't need Config.in and
Makefilein target/device: defconfig files are sufficient to describe the specificities of a board (architecture, compilation flags, bootloader and kernel details, etc.).
How then would you add board-specific configuration options? Suppose that for a certain board you can enable or disable a certain feature. Previously, you'd add such an option in the board-specific Config.in file, which was included via the manufacturer-specific Config.in file, which was included from target/device/Config.in. Now that all these are being removed, what's the strategy?
Related to this: previously some target/device/*/Config.in files added configuration options called BR2_BOARD_NAME and BR2_BOARD_PATH. These could be referenced from other configuration options, for example in target/linux/Config.in.advanced, as the default Linux configuration file. Is this mechanism still supported, or is there an alternative?
Thanks,
Thomas
PATCH 9/55 Stop referencing the crazy target/device stuff
Hello Thomas,
Quoted 6 lines · On Mon, 6 Dec 2010 08:35:32 +0100 Thomas De Schampheleire…
How then would you add board-specific configuration options? Suppose that for a certain board you can enable or disable a certain feature. Previously, you'd add such an option in the board-specific Config.in file, which was included via the manufacturer-specific Config.in file, which was included from target/device/Config.in. Now that all these are being removed, what's the strategy?
Could you give examples of what these options would be ? I think it would depend on which options we're talking about, I don't have a generic answer to this question.
At least in the existing target/device/*/Config.in files, there were no such options.
Quoted 5 lines
Related to this: previously some target/device/*/Config.in files added configuration options called
BR2_BOARD_NAMEandBR2_BOARD_PATH. These could be referenced from other configuration options, for example in target/linux/Config.in.advanced, as the default Linux configuration file. Is this mechanism still supported, or is there an alternative?
target/linux/Config.in.advanced does not exist anymore.
In the U-Boot or Linux configuration, if you need to reference something in the board-specific directory, just use "board/<vendor>/<boardname>/something". For example, in the mini2440 defconfig:
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/friendlyarm/mini2440/linux-2.6.32.2.config"
Regards!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 50/55 xtensa: remove unused and useless skeleton patch
In reply to Marc GauthierHello Marc,
Quoted 6 lines · On Sun, 5 Dec 2010 17:08:50 -0800 Marc Gauthier <[email protected]> wrote:
Hi Thomas,
We're using this particular inittab for our boards. I realize I haven't sync'ed buildroot recently, but is there now a more appropriate way to do this, that makes this approach "useless" ?
Here is the diff between the default skeleton inittab and the xtensa specific inittab (and my comments below) :
device/xtensa/skeleton-patch/etc/inittab renamed from skeleton/etc/inittab +5 -6
@@ -14,26 +14,25 @@ # process == program to run # Startup the system -null::sysinit:/bin/mount -o remount,rw / null::sysinit:/bin/mount -t proc proc /proc -null::sysinit:/bin/mkdir -p /dev/pts +null::sysinit:/bin/mount -o remount,rw / null::sysinit:/bin/mount -a null::sysinit:/bin/hostname -F /etc/hostname # now run any rc scripts ::sysinit:/etc/init.d/rcS # Set up a couple of getty's -tty1::respawn:/sbin/getty 38400 tty1 -tty2::respawn:/sbin/getty 38400 tty2 +#tty1::respawn:/sbin/getty 38400 tty1 +#tty2::respawn:/sbin/getty 38400 tty2 # Put a getty on the serial port -#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL +ttyS0::respawn:/sbin/getty -L ttyS0 38400 vt100 # Logging junk null::sysinit:/bin/touch /var/log/messages null::respawn:/sbin/syslogd -n -m 0 null::respawn:/sbin/klogd -n -tty3::respawn:/usr/bin/tail -f /var/log/messages +#tty3::respawn:/usr/bin/tail -f /var/log/messages # Stuff to do for the 3-finger salute ::ctrlaltdel:/sbin/reboot
So it does three things:
* Moves the read/write remount of the root filesystem after mounting proc, which probably makes sense to have in the default skeleton (there has been a thread recently on the list about this).
* It enables a getty on ttyS0, and we have an option to do that in Buildroot (which this patch set moves to a new "System configuration" menu).
* It removes things from tty1, tty2, tty3. They don't do much harm if tty1, tty2 and tty3 are not visible, but if we really think it's useful to be able to disable them, we can just add some more generic options in the "System configuration" menu.
So I think all those three changes can be handled without having a specific inittab, which is why I called the Xtensa specific one "useless" (sorry if the word sounded offensive, it definitely wasn't my intention).
Does this clarifies what I meant ?
Thanks for your feedback!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 10/55 Remove all Config.in/Makefile.in files in target/device
In reply to a message not in the archiveMarc, Maxim,
[ Since your question is about Buildroot and has nothing that looks
private, I took the freedom to copy the Buildroot list again. ]
Quoted 1 line · On Sun, 5 Dec 2010 17:13:44 -0800 Marc Gauthier <[email protected]> wrote:
So, where do we put the contents of these Config.in / Makefile.in ?
In the existing Config.in/Makefile.in, there were only options to select a particular board.
Quoted 1 line
Are we not to use the config tools to select a given board?
You just need to write a defconfig file for your different boards in the configs/ directory. Those defconfigs file will select, for each of your boards, the correct toolchain, bootloader and kernel configuration.
And then your users could do:
make mywonderfulboard_defconfig
make
To get a Buildroot build that works for "mywonderfulboard".
If you need any help or have questions about how this would work for your use cases, do not hesitate to ask.
Thanks for your feedback!
Regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 9/55 Stop referencing the crazy target/device stuff
In reply to Thomas PetazzoniHello Thomas, (this will become confusing for other readers :-p )
Quoted 12 lines · Thomas Petazzoni
Hello Thomas,
Quoted 6 lines · On Mon, 6 Dec 2010 08:35:32 +0100 Thomas De Schampheleire…
How then would you add board-specific configuration options? Suppose that for a certain board you can enable or disable a certain feature. Previously, you'd add such an option in the board-specific Config.in file, which was included via the manufacturer-specific Config.in file, which was included from target/device/Config.in. Now that all these are being removed, what's the strategy?
Quoted 6 lines
Could you give examples of what these options would be ? I think it would depend on which options we're talking about, I don't have a generic answer to this question.
At least in the existing target/device/*/Config.in files, there were no such options.
For example, in a manufacturer specific Config.in file, I added an option for a new board. This board has two variants, each having a different processor architecture. Other than that, the selection of components for the root filesystem, the kernel etc. would all be the same (except for the kernel configuration).
By adding 'depends on' and 'default' options to the config, I could make the selection for the right board variant automatic based on the global buildroot architecture selection.
e.g.
config MYBOARD
config MYBOARD_PPC
depends on MYBOARD && BR2_powerpc
default y if BR2_powerpc
config MYBOARD_X86
depends on MYBOARD && BR2_i386
default y if BR2_i386
Then, based on the above selection, I'd automatically determine the board name:
config BR2_BOARD_NAME
default "myboard_ppc" if MYBOARD_PPC
default "myboard_x86" if MYBOARD_X86
config BR2_BOARD_PATH
default "target/device/<manufacturer>/$(BR2_BOARD_NAME)"
Additionally, I liked the idea of 'status' targets in the board Makefiles. These targets print out certain configuration variables, e.g. the Linux kernel used, the name of the board selected, etc. This may not need to be in a board-specific file, but in my opinion this is worth implementing globally. Do you agree?
Quoted 7 lines
Quoted 6 lines
Related to this: previously some target/device/*/Config.in files added configuration options called
BR2_BOARD_NAMEandBR2_BOARD_PATH. These could be referenced from other configuration options, for example in target/linux/Config.in.advanced, as the default Linux configuration file. Is this mechanism still supported, or is there an alternative?
Quoted 8 lines
target/linux/Config.in.advanced does not exist anymore.
In the U-Boot or Linux configuration, if you need to reference something in the board-specific directory, just use "board/<vendor>/<boardname>/something". For example, in the mini2440 defconfig:
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/friendlyarm/mini2440/linux-2.6.32.2.config"
The disadvantage of this is that the above configuration setting needs to change if the board name changes. If the board name is abstracted in a variable like BR2_BOARD_NAME, the setting stays the same (although of course the expanded string is different). This makes configuration files more generic.
Here again, having a board name setting may be something that can be moved to the global buildroot settings, available for every board. What do you think?
Thanks,
Thomas
PATCH 9/55 Stop referencing the crazy target/device stuff
Hello Thomas,
Quoted 1 line · On Tue, 7 Dec 2010 08:26:31 +0100 Thomas De Schampheleire…
Hello Thomas, (this will become confusing for other readers :-p )
Yes, but it's funny :-)
Quoted 25 lines
Quoted 2 lines
At least in the existing target/device/*/Config.in files, there were no such options.
For example, in a manufacturer specific Config.in file, I added an option for a new board. This board has two variants, each having a different processor architecture. Other than that, the selection of components for the root filesystem, the kernel etc. would all be the same (except for the kernel configuration).
By adding 'depends on' and 'default' options to the config, I could make the selection for the right board variant automatic based on the global buildroot architecture selection.e.g.
config MYBOARD
configMYBOARD_PPC
depends on MYBOARD &&BR2_powerpc
default y ifBR2_powerpcconfig
MYBOARD_X86
depends on MYBOARD &&BR2_i386
default y ifBR2_i386Then, based on the above selection, I'd automatically determine the board name:
Quoted 6 lines
config
BR2_BOARD_NAME
default "myboard_ppc" ifMYBOARD_PPC
default "myboard_x86" ifMYBOARD_X86config
BR2_BOARD_PATHdefault "target/device/<manufacturer>/$(BR2_BOARD_NAME)"
Just provide two different defconfig files for your two boards.
Quoted 5 lines
Additionally, I liked the idea of 'status' targets in the board Makefiles. These targets print out certain configuration variables, e.g. the Linux kernel used, the name of the board selected, etc. This may not need to be in a board-specific file, but in my opinion this is worth implementing globally. Do you agree?
With my changes, there isn't anymore the concept of a "board" inside Buildroot, because IMO it doesn't make sense. A "board" is just a initial configuration file that is known to work for a particular hardware platform, but a defconfig file should be sufficient. So from that perspective, there's no way Buildroot would know the "board" name. The user just starts by doing :
make foobar_defconfig
and (s)he knows that the architecture, kernel, bootloader are correct, and so (s)he can go ahead with
make menuconfig
and add whatever software is needed for the system (s)he is building.
With regard to the version of the Linux kernel selected or things like that, we could obviously add a "make status" thing, but I don't really what this would buy us compared to running "make menuconfig". And what do we put in this "make status" ? The version of the kernel ? Why only ? There should be the version of all the components, no ?
Quoted 4 lines
Quoted 1 line
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/friendlyarm/mini2440/linux-2.6.32.2.config"
The disadvantage of this is that the above configuration setting needs to change if the board name changes.
If the name of the board changes, you have to rename the defconfig file *and rename the directory. So changing two paths in the defconfig file shouldn't be a very big deal compared to all the renames already needed. And renaming a board is really a corner use case, for which changing two paths in a defconfig sounds reasonable.
Quoted 4 lines
If the board name is abstracted
in a variable likeBR2_BOARD_NAME, the setting stays the same (although of course the expanded string is different). This makes configuration files more generic.
Configuration files are specific to a particular board. Even their name is, so I don't see the point of making them whatsoever generic :-)
I agree that my patch set is changing things, but that's why it has been written in the first place.
Regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 50/55 xtensa: remove unused and useless skeleton patch
In reply to Thomas PetazzoniHi Thomas,
Quoted 2 lines · Thomas Petazzoni
Here is the diff between the default skeleton inittab and the xtensa specific inittab (and my comments below) :
[...]
Quoted 5 lines
So it does three things:
* Moves the read/write remount of the root filesystem after mounting proc, which probably makes sense to have in the default skeleton (there has been a thread recently on the list about this).
Ok.
Quoted 3 lines
* It enables a getty on ttyS0, and we have an option to do that in Buildroot (which this patch set moves to a new "System configuration" menu).
Ah, interesting.
Quoted 4 lines
* It removes things from tty1, tty2, tty3. They don't do much harm if tty1, tty2 and tty3 are not visible, but if we really think it's useful to be able to disable them, we can just add some more generic options in the "System configuration" menu.
I forget what effect this might have if any. Will have to try again.
Quoted 6 lines
So I think all those three changes can be handled without having a specific inittab, which is why I called the Xtensa specific one "useless" (sorry if the word sounded offensive, it definitely wasn't my intention).
Does this clarifies what I meant ?
Yes, very much. I'm happy to call the file "useless" (or whatever it rightly deserves ;-) , just wanted to understand why.
Thanks!
-Marc
Quoted 3 lines
Thanks for your feedback!
Thomas
PATCH 9/55 Stop referencing the crazy target/device stuff
In reply to Thomas PetazzoniHello Thomas,
Quoted 87 lines · Thomas Petazzoni
Hello Thomas,
Quoted 1 line · On Tue, 7 Dec 2010 08:26:31 +0100 Thomas De Schampheleire…
Hello Thomas, (this will become confusing for other readers :-p )
Yes, but it's funny :-)
Quoted 25 lines
Quoted 2 lines
At least in the existing target/device/*/Config.in files, there were no such options.
For example, in a manufacturer specific Config.in file, I added an option for a new board. This board has two variants, each having a different processor architecture. Other than that, the selection of components for the root filesystem, the kernel etc. would all be the same (except for the kernel configuration).
By adding 'depends on' and 'default' options to the config, I could make the selection for the right board variant automatic based on the global buildroot architecture selection.e.g.
config MYBOARD
? ? configMYBOARD_PPC
? ? ? ? depends on MYBOARD &&BR2_powerpc
? ? ? ? default y ifBR2_powerpc? ? config
MYBOARD_X86
? ? ? ? depends on MYBOARD &&BR2_i386
? ? ? ? default y ifBR2_i386Then, based on the above selection, I'd automatically determine the board name:
Quoted 6 lines
config
BR2_BOARD_NAME
? ? default "myboard_ppc" ifMYBOARD_PPC
? ? default "myboard_x86" ifMYBOARD_X86config
BR2_BOARD_PATH
? ? default "target/device/<manufacturer>/$(BR2_BOARD_NAME)"Just provide two different defconfig files for your two boards.
Quoted 5 lines
Additionally, I liked the idea of 'status' targets in the board Makefiles. These targets print out certain configuration variables, e.g. the Linux kernel used, the name of the board selected, etc. This may not need to be in a board-specific file, but in my opinion this is worth implementing globally. Do you agree?
With my changes, there isn't anymore the concept of a "board" inside Buildroot, because IMO it doesn't make sense. A "board" is just a initial configuration file that is known to work for a particular hardware platform, but a defconfig file should be sufficient. So from that perspective, there's no way Buildroot would know the "board" name. The user just starts by doing :
? ? ? ?make
foobar_defconfigand (s)he knows that the architecture, kernel, bootloader are correct, and so (s)he can go ahead with
? ? ? ?make menuconfig
and add whatever software is needed for the system (s)he is building.
With regard to the version of the Linux kernel selected or things like that, we could obviously add a "make status" thing, but I don't really what this would buy us compared to running "make menuconfig". And what do we put in this "make status" ? The version of the kernel ? Why only ? There should be the version of all the components, no ?
Quoted 4 lines
Quoted 1 line
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/friendlyarm/mini2440/linux-2.6.32.2.config"
The disadvantage of this is that the above configuration setting needs to change if the board name changes.
If the name of the board changes, you have to rename the defconfig file *and rename the directory. So changing two paths in the defconfig file shouldn't be a very big deal compared to all the renames already needed. And renaming a board is really a corner use case, for which changing two paths in a defconfig sounds reasonable.
Quoted 4 lines
If the board name is abstracted
in a variable likeBR2_BOARD_NAME, the setting stays the same (although of course the expanded string is different). This makes configuration files more generic.
Quoted 5 lines
Configuration files are specific to a particular board. Even their name is, so I don't see the point of making them whatsoever generic :-)
I agree that my patch set is changing things, but that's why it has been written in the first place.
Ok. I can live with the new way of working. I'll go ahead and adapt based on your replies above.
Best regards,
Thomas
[Buildroot] skeleton updates
In reply to Thomas PetazzoniHi Guys,
I am trying to follow up with Marcus Osdoba's work on dockstar and get something ready to submit to buildroot.
I am having a real problem figuring out how stuff makes it into the the final etc directory. My patch script in the target/device/sheevaplug/SeagateDockStar/patchrootfs.sh copies new files (inittab and shadow into output/target/skeleton/etc/ and this happens on re-invocation of make. However when I look at the rootfs.tar file the updated inittab is not there. Can anyone describe how the various /etc/ files in fs/skeleton and target/device/...skeleton and the final patch file get to the final output image files.
Thanks, Steve
[Buildroot] skeleton updates
Hey,
Quoted 7 lines
-----Original Message-----
From: buildroot-bounces at busybox.net [mailto:buildroot- bounces at busybox.net] On Behalf Of Steve Calfee
Sent: Friday, December 10, 2010 12:47 AM
To: Thomas Petazzoni; buildroot at uclibc.org
Subject: [Buildroot] skeleton updates
Quoted 6 lines
Hi Guys,
I am trying to follow up with Marcus Osdoba's work on dockstar and get something ready to submit to buildroot.
I am having a real problem figuring out how stuff makes it into the the
final
Quoted 5 lines
etc directory. My patch script in the
target/device/sheevaplug/SeagateDockStar/patchrootfs.shcopies new files (inittab and shadow into output/target/skeleton/etc/ and this happens on re-invocation of make. However when I look at the rootfs.tar file the updated inittab is not there. Can anyone describe how the various/etc/
files
Quoted 1 line
in fs/skeleton and target/device/...skeleton and the final patch file get
to the
Quoted 1 line
final output image files.
The best place to add these customizations is BR2_ROOTFS_POST_BUILD_SCRIPT, which you can find under "Target filesystem options" in menuconfig. This script is called after everything is build, but before the target filesystem is generated.
Here's the example I use:
BR2_ROOTFS_POST_BUILD_SCRIPT="$(TOPDIR)/$(BOARD_PATH)/customize_target.sh"
Signature · 3 lines
Regards Heiko Zuerker http://www.devil-linux.org
[Buildroot] skeleton updates
----- Original Message ----
Quoted 21 lines
From: Heiko Zuerker <[email protected]>
Quoted 9 lines
From: buildroot-bounces at busybox.net [mailto:buildroot-
Subject: [Buildroot] skeleton updatesHi Guys,
I am trying to follow up with Marcus Osdoba's work on dockstar and get
something ready to submit to buildroot.I am having a real problem figuring out how stuff makes it into the the
final
Quoted 5 lines
etc directory. My patch script in the
target/device/sheevaplug/SeagateDockStar/patchrootfs.shcopies new files (inittab and shadow into output/target/skeleton/etc/ and this happens on re-invocation of make. However when I look at the rootfs.tar file the updated inittab is not there. Can anyone describe how the various/etc/files
Quoted 1 line
in fs/skeleton and target/device/...skeleton and the final patch file get
to the
Quoted 1 line
final output image files.
Quoted 8 lines
The best place to add these customizations is
BR2_ROOTFS_POST_BUILD_SCRIPT, which you can find under "Target filesystem options" in menuconfig. This script is called after everything is build, but before the target filesystem is generated.Here's the example I use:
BR2_ROOTFS_POST_BUILD_SCRIPT="$(TOPDIR)/$(BOARD_PATH)/customize_target.sh"
Hi thanks for the comment. I am using that script and it gets invoked during the build.
Investigating further, I was copying into the wrong output directory.
The way I implemented rootfs updates, is I just have a device directory with the skeleton of things I want installed, and it gets copied over the default stuff from the build. In the case of the default all I am changing is inittab and shadow, but any file could be added there to replace or add to the default fs/skeleton.
[Buildroot] skeleton updates
Quoting Steve Calfee <[email protected]>:
Quoted 32 lines
----- Original Message ----
Quoted 21 lines
From: Heiko Zuerker <[email protected]>
Quoted 9 lines
From: buildroot-bounces at busybox.net [mailto:buildroot-
Subject: [Buildroot] skeleton updatesHi Guys,
I am trying to follow up with Marcus Osdoba's work on dockstar and get
something ready to submit to buildroot.I am having a real problem figuring out how stuff makes it into the the
final
Quoted 5 lines
etc directory. My patch script in the
target/device/sheevaplug/SeagateDockStar/patchrootfs.shcopies new files (inittab and shadow into output/target/skeleton/etc/ and this happens on re-invocation of make. However when I look at the rootfs.tar file the updated inittab is not there. Can anyone describe how the various/etc/files
Quoted 1 line
in fs/skeleton and target/device/...skeleton and the final patch file get
to the
Quoted 1 line
final output image files.
Quoted 8 lines
The best place to add these customizations is
BR2_ROOTFS_POST_BUILD_SCRIPT, which you can find under "Target filesystem options" in menuconfig. This script is called after everything is build, but before the target filesystem is generated.Here's the example I use:
BR2_ROOTFS_POST_BUILD_SCRIPT="$(TOPDIR)/$(BOARD_PATH)/customize_target.sh"
Quoted 5 lines
Hi thanks for the comment. I am using that script and it gets invoked during the
build.Investigating further, I was copying into the wrong output directory.
Not sure if you know this, but the target path is actually passed as the only option to the script.
I set
TARGET_PATH=${1}
and from then from there on just work with that variable.
Quoted 7 lines
The way I implemented rootfs updates, is I just have a device directory with the
skeleton of things I want installed, and it gets copied over the default stuff
from the build. In the case of the default all I am changing is inittab and shadow, but any file could be added there to replace or add to the default fs/skeleton.
Signature · 7 lines
Regards Heiko Zuerker http://www.devil-linux.org ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
PATCH 14/55 documentation: Update to explain how board support works
In reply to Thomas Petazzoni----- Original Message ----
docs/buildroot.html
Quoted 14 lines
From: Thomas Petazzoni <[email protected]>
Subject: [Buildroot] [PATCH 14/55] documentation: Update to explain how board support worksSigned-off-by Thomas Petazzoni <[email protected]>--- docs/buildroot.html | 117 ++++++++++++++++----------------------------------- 1 files changed, 36 insertions(+), 81 deletions(-)docs/buildroot.html +0
-0
<<snip>>
docs/buildroot.html $(ZLIB_DIR)/libz.a: $(ZLIB_DIR)/.configured · line 601
Quoted 6 lines
docs/buildroot.html +6
-0+ <p>Once you have a known working configuration, run <code>make + savedefconfig</code>. This will generate a + minimal <code>defconfig</code> file at the root of the Buildroot + source tree. Move this file into the <code>configs/</code> + directory, and rename it <code>MYBOARD_defconfig</code>.</p> +
Hi Thomas,
I am trying to prepare a board support package. I have run this step and stuff disappeared from the .config, for instance:
BR2_ARM_TYPE="ARM926T"
BR2_ARM_EABI=y
# BR2_ARM_OABI is not set
BR2_ARCH="arm"
BR2_ENDIAN="LITTLE"
BR2_GCC_TARGET_TUNE="arm926ej-s"
BR2_GCC_TARGET_ARCH="armv5te"
BR2_GCC_TARGET_ABI="aapcs-linux"
Is this normal? It takes so long to completely rebuild, but they don't seem to matter. If you say savedefconfig is enough, ok with me.
Regards, Steve
PATCH 14/55 documentation: Update to explain how board support works
Steve,
Quoted 2 lines · On Fri, 10 Dec 2010 20:37:57 -0800 (PST) Steve Calfee <[email protected]>…
I am trying to prepare a board support package. I have run this step and stuff disappeared from the .config, for instance:
When you run "savedefconfig", it generates a defconfig file that contains the value only for the config options that are not of the default value, and that cannot be computed from other options.
Quoted 1 line
BR2_ARM_TYPE="ARM926T"
This is an hidden option, whose value is selected depending on BR2_arm926t. So if you have BR2_arm926t=y in your defconfig, having BR2_ARM_TYPE="ARM926T" is useless: it will be computed automatically.
Quoted 1 line
BR2_ARM_EABI=y
This is the default.
Quoted 1 line
#
BR2_ARM_OABIis not set
This is the default.
Quoted 5 lines
BR2_ARCH="arm"
BR2_ENDIAN="LITTLE"
BR2_GCC_TARGET_TUNE="arm926ej-s"
BR2_GCC_TARGET_ARCH="armv5te"
BR2_GCC_TARGET_ABI="aapcs-linux"
All those are hidden options, whose value is computed from the value of other options, so there's no need to store them in defconfig files.
Quoted 2 lines
Is this normal? It takes so long to completely rebuild, but they don't seem to matter. If you say savedefconfig is enough, ok with me.
savedefconfig is enough. For all options that you were wondering about, having:
BR2_arm=y
BR2_arm926t=y
in your savedefconfig is sufficient.
Regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 44/55 Add network scripting folders to fs/skeleton
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> From: Yegor Yefremov <[email protected]> Thomas> Those folders are currently created using makedevs according to the Thomas> specifications in device_table.txt. However, as makedevs is no longer Thomas> executed when dynamic device creation methods are selected (devtmpfs, Thomas> udev, mdev), those folders must be created differently. We choose to Thomas> put them directly into the default filesystem skeleton.
While this is not wrong, it's also not complete. Even with dynamic dev, we still need a device_table.txt to get proper permissions on /bin/busybox, /etc/shadow, /etc/passwd and so on.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 45/55 Create menu entry to select device creation method
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> From: Yegor Yefremov <[email protected]> Thomas> Four methods for the creation of device files in /dev are now Thomas> proposed:
Thomas> - static method uses device table as before Thomas> - devtmpfs method enables this feature in kernel Thomas> - mdev method adds mdev starting script to the file system
Thomas> and selects mdev itself for installation
Thomas> - udev method selects udev for installation
Thomas> All dynamic methods are based on devtmpfs, so one doesn't need to care Thomas> about /dev folder.
Thomas> config BR2_ROOTFS_DEVICE_TABLE
Thomas> - string "Path to the device table" Thomas> - default "target/generic/device_table.txt" Thomas> - help Thomas> - Specify the location of a device table, that will be passed Thomas> - to the makedevs utility to create all the special device Thomas> - files in the target filesystem. Thomas> + string "Path to the device table" Thomas> + depends on BR2_ROOTFS_DEVICE_CREATION_STATIC Thomas> + default "target/generic/device_table.txt" Thomas> + help Thomas> + Specify the location of a device table, that will be passed Thomas> + to the makedevs utility to create all the special device Thomas> + files in the target filesystem.
Like mentioned before, I think we should still use a (smaller) device_table.txt for stuff using devtmpfs for busybox/passwd/shadow permissions.
Devtmpfs also gets mounted on top of the rootfs, so it shadows the content of /dev, which means we'll have to add a:
null::sysinit:/bin/mkdir -p /dev/pts
To the inittab, or devpts stuff like dropbear will fail.
Thomas> diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk Thomas> index b7f4740..d4b04a9 100644
Thomas> --- a/package/busybox/busybox.mk
Thomas> +++ b/package/busybox/busybox.mk
Thomas> @@ -20,6 +20,19 @@ ifndef BUSYBOX_CONFIG_FILE
Thomas> BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG))
Thomas> endif
Thomas> +# If mdev will be used for device creation enable it and copy S10mdev to /etc/init.d Thomas> +ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),y)
Thomas> +define BUSYBOX_INSTALL_MDEV_SCRIPT
Thomas> + install -m 0755 package/busybox/S10mdev $(TARGET_DIR)/etc/init.d
Thomas> +endef
Thomas> +define BUSYBOX_SET_MDEV
Thomas> + $(call KCONFIG_ENABLE_OPT,CONFIG_MDEV,$(BUSYBOX_BUILD_CONFIG))
Thomas> + $(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MDEV_CONF,$(BUSYBOX_BUILD_CONFIG))
Thomas> + $(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MDEV_EXEC,$(BUSYBOX_BUILD_CONFIG))
Thomas> + $(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MDEV_LOAD_FIRMWARE,$(BUSYBOX_BUILD_CONFIG))
I would prefer to keep these overrides to a strict minimum - As an example, I've used mdev in the past without firmware and exec support.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 47/55 linux: support a space-separated list of patches
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> The kernel being a component that often needs a fairly important set Thomas> of changes to be adapted to a particular hardware platform, having Thomas> maximum flexibility on the patching process is a nice Thomas> thing. Therefore, as per the discussions from the Buildroot Developer Thomas> Day, we add a mechanism to apply a list of patches (that could come Thomas> either from URLs, local files or local directories).
Thomas> + for p in $(LINUX26_PATCH) ; do \
Thomas> + if echo $$p | grep -q -E "^ftp://|^http://" ; then \
Thomas> + toolchain/patch-kernel.sh $(@D) $(DL_DIR) basename $$p ; \
Thomas> + elif test -d $$p ; then \
Thomas> + toolchain/patch-kernel.sh $(@D) $$p linux-\*.patch ; \
Thomas> + else \
Thomas> + toolchain/patch-kernel.sh $(@D) dirname $$p basename $$p ; \
Thomas> + fi \
It would be a bit more efficient to do it in shell with a case statement, E.G.:
case "$$p" in
http://*|http://*) toolchain/patch-kernel .. ;; *) if [ -d $$p ]; then ..
esac
But not a big deal.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 47/55 linux: support a space-separated list of patches
Quoted 2 lines · On Thursday, December 16, 2010 16:34:18 Peter Korsgaard wrote:
case "$$p" in
http://*|http://*)
guessing you meant ftp://|http://
also, this patch reminds me of common problem in buildroot. why do people use dirname and basename ? these really should be letting the shell do it
like ${f##*/} and ${f%/*}. or use make's builtins.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20101216/8b988f9c/attachment.pgp>
PATCH 47/55 linux: support a space-separated list of patches
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Mike" == Mike Frysinger <[email protected]> writes:
Quoted 2 lines · Mike> On Thursday, December 16, 2010 16:34:18 Peter Korsgaard wrote:
Quoted 2 lines
case "$$p" in
http://*|http://*)
Mike> guessing you meant ftp://|http://
Ehh, sure.
Mike> also, this patch reminds me of common problem in buildroot. why do people use Mike> dirname and basename ? these really should be letting the shell do it Mike> like ${f##*/} and ${f%/*}. or use make's builtins.
You cannot use make function as it's part of a shell loop, but shell builtins could be used, sure - Even though shell parameter expansion in combination with make escape rules starts to resemble line noise ;)
Signature · 1 line
Bye, Peter Korsgaard
PATCH 47/55 linux: support a space-separated list of patches
Quoted 7 lines · On Friday, December 17, 2010 04:41:18 Peter Korsgaard wrote:
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Mike" == Mike Frysinger writes:
also, this patch reminds me of common problem in buildroot. why do people use
dirnameandbasename? these really should be letting the shell do it like ${f##*/} and ${f%/*}. or use make's builtins.You cannot use make function as it's part of a shell loop
i was making general statements
Quoted 3 lines
but shell
builtins could be used, sure - Even though shell parameter expansion in combination with make escape rules starts to resemble line noise ;)
perhaps, but i'd prefer line noise over excess build forks/execs. i think though it's more a matter of training your eyes to recognize these things.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20101217/f1c8a6e4/attachment.pgp>
PATCH 48/55 linux: always enable support for tmpfs in the kernel
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> Our default /etc/fstab uses tmpfs to mount the /tmp directory, so it Thomas> sounds like a good idea to enable this filesystem by default.
Hmm, I'm not thrilled about this. If you don't have the full SHMEM filesystem enabled (which I would say is relatively common on the kind of small systems without swap we're targetting), you have ramfs rather than tmpfs, and you CAN use a custom fs skeleton, so tmpfs might not be needed (E.G. for an initramfs).
In general, I would like to keep the hardcoded options to a minimum.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 49/55 Improve handling of mdev/udev
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> Yegor Yefremov introduced udev/mdev integration, but it relies on Thomas> devtmpfs and does not use tmpfs on /dev, which is the purpose of Thomas> mdev/udev. This commit improves how mdev and udev are handled in Thomas> Buildroot.
Thomas> At compile time, only a minimal /dev is created in the filesystem, Thomas> with only "console" and "null". This is done thanks to a small device Thomas> table in target/generic/device_table_mdev_udev.txt. This is done Thomas> directly at the configuration level (fs/Config.in).
While I agree we need the minimal device table for /etc/shadow and similar permissions, do we really need to support mdev/udev without devtmpfs? It's been in the kernel now for close to 2 years, it's very small and it simplifies (and speeds up) the boot sequence quite a lot.
Signature · 1 line
Bye, Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> Hello,
Thomas> Here is the set of patches that reworks how Buildroot support Thomas> boards. Now, the principles are :
Thanks a lot! Committed everything except for patch 45, 48 and 49.
Signature · 1 line
Bye, Peter Korsgaard
Quoted 1 line · On Fri, 17 Dec 2010 17:01:05 +0100 Peter Korsgaard <[email protected]> wrote:
Thanks a lot! Committed everything except for patch 45, 48 and 49.
Thanks, I'll rework 45, 48 and 49 as per your comments, and provide a new branch with only those commits. Thanks for picking all the other patches, it's much easier to handle a 3-patches patch set than a 55-patches patch set :-)
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 49/55 Improve handling of mdev/udev
In reply to Thomas PetazzoniQuoted 35 lines · Thomas Petazzoni
Yegor Yefremov introduced udev/mdev integration, but it relies on devtmpfs and does not use tmpfs on /dev, which is the purpose of mdev/udev. This commit improves how mdev and udev are handled in Buildroot.
At compile time, only a minimal /dev is created in the filesystem, with only "console" and "null". This is done thanks to a small device table in
target/generic/device_table_mdev_udev.txt. This is done directly at the configuration level (fs/Config.in).Moreover, at compile time, the mounting of a tmpfs filesystem in /dev is enabled/disabled in
/etc/inittabdepending on whether udev/mdev are used or not. This is done in target/generic/Makefile.in, together with other hooks to tune the target filesystem (hostname, serial port, etc.).At run time, what happens is :
* inittab sysinit actions are executed. They do: remount the root filesystem read/write, mount the proc filesystem, mount a tmpfs filesystem in /dev, create the
/dev/ptsdirectory and then mount all filesystems listed in fstab.* initialization scripts are started, with S10mdev or S10udev being at the very beginning of the list of scripts to be executed.
Between the moment at which a tmpfs filesystem is mounted in /dev and the moment S10mdev or S10udev are executed, the /dev directory is empty of devices. This is why the "null" device is no longer used to redirect messages from sysinit actions.
The kernel compilation code is improved to only enable devtmpfs in the configuration when the devtmpfs method is used. udev/mdev do not require devtmpfs, only tmpfs.
Quoted 5 lines
Finally, the S10udev startup script is simplified, as it handled unnecessary things: mount sysfs, mount a tmpfs filesystem in
/dev/, etc.Signed-off-by Thomas Petazzoni<[email protected]>
Hi Thomas/Peter,
What is the status of this patch? Will it or something similar get merged this development cycle. I'm looking to update to a newer buildroot version internally and I'll either need this patch or something I've written myself and would rather stay in sync with upstream.
Thanks
Will
Signature · 5 lines
------------------------------------------------------------------------ Will Wagner will_wagner at carallon.com Development Manager Office Tel: +44 (0)20 7371 2032 Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA ------------------------------------------------------------------------
PATCH 49/55 Improve handling of mdev/udev
Quoted 4 lines · On Mon, 07 Mar 2011 18:52:35 +0000 William Wagner <[email protected]>…
What is the status of this patch? Will it or something similar get merged this development cycle. I'm looking to update to a newer buildroot version internally and I'll either need this patch or something I've written myself and would rather stay in sync with upstream.
I have updated this patch set last week to take into account comments from Peter, so I hope to be able to send it rather soon.
Regards!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com