Re: [OpenWrt-Devel] [PATCH 2/3] build: use options to add kernels/dtbs in rootfs

2014-08-12 Thread Felix Fietkau
On 2014-08-12 13:48, Luka Perkov wrote:
> On Tue, Aug 12, 2014 at 01:12:50PM +0200, Jonas Gorski wrote:
>> On Mon, Aug 11, 2014 at 10:48 PM, Luka Perkov  wrote:
>> > On Mon, Aug 11, 2014 at 10:06:27PM +0200, Felix Fietkau wrote:
>> >> On 2014-08-11 10:47, Luka Perkov wrote:
>> >> > Use support for options to enable targets and profiles select kernel or 
>> >> > dtb
>> >> > inclusion by default.
>> >> >
>> >> > Signed-off-by: Luka Perkov 
>> >> What's the rationale for having this stuff as config options in the
>> >> first place? It seems to me that it makes a lot more sense to control
>> >> this from the target's image/Makefile.
>> >
>> > Here are the reasons:
>> >
>> > * Simplified image/Makefile for targets, no extra ifdefs
>> 
>> .. which makes it impossible to build images for both a device needing
>> it and a device not needing it at the same time.
>  
> ... but that is how build system works now.
That's not a valid reason for carrying forward bad design decisions.

> This patch series is not a
> stopper for the the fix of the problem you are pointing out here. If you
> have better way to deal with this feel free to send a patch. And don't
> forget to take in account third point below.
I refuse to make problem worse just for the sake of working around the
consequences of earlier bad decision making and a few other questionable
decisions.

>> > * Users can select if they want to include kernel/dtb or not - it is not
>> > hardcoded in the image/Makefile. For example, if one is building ramdisk
>> > image only no need to include kernel in rootfs.
>> 
>> As a user, I would not want to have to make that decision. Either the
>> device needs the kernel in the rootfs, then it should be automatically
>> included, or it does not, then it shoudn't be there. If it isn't
>> needed for initramfs kernels, then selection state shouldn't have any
>> effect on the ramdisk contents.
> 
> Then as a user don't touch default settings ;)
It does not make sense to have options for stuff that the user shouldn't
change anyway. Configuration bloat should be avoided.

>> > * Introduces ground work for including other options which can not be
>> > built as modules. Such as lxc/kexec support by default.
>> 
>> As I said on 1/3, lxc/kexec is a bad example. An IB built with profile
>> A selected and an IB built with profile B selected should be able to
>> create identical* images, regardless of which profile was selected
>> while building the IB.
> 
> As explained in the other email lxc/kexec would be set at target level
> and not on the profile level. That said, the point you are making does
> not make any sense to me.
I consider LXC something that explicitly should not be enabled by the
target itself. It should be enabled by the user, a use-case specific
defconfig or a disabled-by-default meta-package. For kexec it should
probably be the same.

Profiles should not be allowed to define build options that cannot be
processed by something like the image builder. That's also the reason
why we rejected the idea of having profiles affect the kernel config.

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/3] build: use options to add kernels/dtbs in rootfs

2014-08-12 Thread Luka Perkov
On Tue, Aug 12, 2014 at 01:12:50PM +0200, Jonas Gorski wrote:
> On Mon, Aug 11, 2014 at 10:48 PM, Luka Perkov  wrote:
> > On Mon, Aug 11, 2014 at 10:06:27PM +0200, Felix Fietkau wrote:
> >> On 2014-08-11 10:47, Luka Perkov wrote:
> >> > Use support for options to enable targets and profiles select kernel or 
> >> > dtb
> >> > inclusion by default.
> >> >
> >> > Signed-off-by: Luka Perkov 
> >> What's the rationale for having this stuff as config options in the
> >> first place? It seems to me that it makes a lot more sense to control
> >> this from the target's image/Makefile.
> >
> > Here are the reasons:
> >
> > * Simplified image/Makefile for targets, no extra ifdefs
> 
> .. which makes it impossible to build images for both a device needing
> it and a device not needing it at the same time.
 
... but that is how build system works now. This patch series is not a
stopper for the the fix of the problem you are pointing out here. If you
have better way to deal with this feel free to send a patch. And don't
forget to take in account third point below.

> > * Users can select if they want to include kernel/dtb or not - it is not
> > hardcoded in the image/Makefile. For example, if one is building ramdisk
> > image only no need to include kernel in rootfs.
> 
> As a user, I would not want to have to make that decision. Either the
> device needs the kernel in the rootfs, then it should be automatically
> included, or it does not, then it shoudn't be there. If it isn't
> needed for initramfs kernels, then selection state shouldn't have any
> effect on the ramdisk contents.

Then as a user don't touch default settings ;)

> > * Introduces ground work for including other options which can not be
> > built as modules. Such as lxc/kexec support by default.
> 
> As I said on 1/3, lxc/kexec is a bad example. An IB built with profile
> A selected and an IB built with profile B selected should be able to
> create identical* images, regardless of which profile was selected
> while building the IB.

As explained in the other email lxc/kexec would be set at target level
and not on the profile level. That said, the point you are making does
not make any sense to me.

> Jonas
> * apart from time stamps

And user who run the build and machine it was built on. If we get picky
we could probably find couple of other things.

Luka
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/3] build: use options to add kernels/dtbs in rootfs

2014-08-12 Thread Jonas Gorski
On Mon, Aug 11, 2014 at 10:48 PM, Luka Perkov  wrote:
> On Mon, Aug 11, 2014 at 10:06:27PM +0200, Felix Fietkau wrote:
>> On 2014-08-11 10:47, Luka Perkov wrote:
>> > Use support for options to enable targets and profiles select kernel or dtb
>> > inclusion by default.
>> >
>> > Signed-off-by: Luka Perkov 
>> What's the rationale for having this stuff as config options in the
>> first place? It seems to me that it makes a lot more sense to control
>> this from the target's image/Makefile.
>
> Here are the reasons:
>
> * Simplified image/Makefile for targets, no extra ifdefs

.. which makes it impossible to build images for both a device needing
it and a device not needing it at the same time.

> * Users can select if they want to include kernel/dtb or not - it is not
> hardcoded in the image/Makefile. For example, if one is building ramdisk
> image only no need to include kernel in rootfs.

As a user, I would not want to have to make that decision. Either the
device needs the kernel in the rootfs, then it should be automatically
included, or it does not, then it shoudn't be there. If it isn't
needed for initramfs kernels, then selection state shouldn't have any
effect on the ramdisk contents.

> * Introduces ground work for including other options which can not be
> built as modules. Such as lxc/kexec support by default.

As I said on 1/3, lxc/kexec is a bad example. An IB built with profile
A selected and an IB built with profile B selected should be able to
create identical* images, regardless of which profile was selected
while building the IB.


Jonas
* apart from time stamps
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/3] build: use options to add kernels/dtbs in rootfs

2014-08-11 Thread Luka Perkov
On Mon, Aug 11, 2014 at 10:06:27PM +0200, Felix Fietkau wrote:
> On 2014-08-11 10:47, Luka Perkov wrote:
> > Use support for options to enable targets and profiles select kernel or dtb
> > inclusion by default.
> > 
> > Signed-off-by: Luka Perkov 
> What's the rationale for having this stuff as config options in the
> first place? It seems to me that it makes a lot more sense to control
> this from the target's image/Makefile.

Here are the reasons:

* Simplified image/Makefile for targets, no extra ifdefs
* Users can select if they want to include kernel/dtb or not - it is not
hardcoded in the image/Makefile. For example, if one is building ramdisk
image only no need to include kernel in rootfs.
* Introduces ground work for including other options which can not be
built as modules. Such as lxc/kexec support by default.

Luka
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/3] build: use options to add kernels/dtbs in rootfs

2014-08-11 Thread Felix Fietkau
On 2014-08-11 10:47, Luka Perkov wrote:
> Use support for options to enable targets and profiles select kernel or dtb
> inclusion by default.
> 
> Signed-off-by: Luka Perkov 
What's the rationale for having this stuff as config options in the
first place? It seems to me that it makes a lot more sense to control
this from the target's image/Makefile.

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/3] build: use options to add kernels/dtbs in rootfs

2014-08-11 Thread Luka Perkov
Use support for options to enable targets and profiles select kernel or dtb
inclusion by default.

Signed-off-by: Luka Perkov 
---
 config/Config-images.in  | 49 
 target/linux/mxs/profiles/01-duckbill.mk |  5 +++-
 2 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 39e51e4..2509e09 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -274,44 +274,69 @@ menu "Target Images"
  you probably want the default (/dev/sda2).
 
 
+   config HAVE_TARGET_ROOTFS_INCLUDE_KERNEL
+   bool
+   default n
+
menuconfig TARGET_ROOTFS_INCLUDE_KERNEL
bool "Include kernel in root filesystem"
depends on TARGET_ROOTFS_UBIFS || TARGET_ROOTFS_EXT4FS
-   default n
+   default y if HAVE_TARGET_ROOTFS_INCLUDE_KERNEL
help
- Include the kernel image in the rootfs. Typically the image 
is placed
- below /boot.
+ Include the kernel image in the rootfs. Typically the image
+ is placed below /boot.
+
+
+   if TARGET_ROOTFS_INCLUDE_KERNEL
+
+   config HAVE_TARGET_ROOTFS_INCLUDE_UIMAGE
+   bool
+   default n
 
config TARGET_ROOTFS_INCLUDE_UIMAGE
-   bool "include uImage" if TARGET_ROOTFS_INCLUDE_KERNEL
-   default y
+   bool "include uImage"
+   default y if HAVE_TARGET_ROOTFS_INCLUDE_UIMAGE
help
  This option might not apply to all targets. Make sure
  to check target/linux//image/Makefile to
  see if this option will have any effect.
 
+   config HAVE_TARGET_ROOTFS_INCLUDE_ZIMAGE
+   bool
+   default n
+
config TARGET_ROOTFS_INCLUDE_ZIMAGE
-   bool "include zImage" if TARGET_ROOTFS_INCLUDE_KERNEL
-   default y
+   bool "include zImage"
+   default y if HAVE_TARGET_ROOTFS_INCLUDE_ZIMAGE
help
  This option might not apply to all targets. Make sure
  to check target/linux//image/Makefile to
  see if this option will have any effect.
 
+   config HAVE_TARGET_ROOTFS_INCLUDE_FIT
+   bool
+   default n
+
config TARGET_ROOTFS_INCLUDE_FIT
-   bool "include FIT" if TARGET_ROOTFS_INCLUDE_KERNEL
-   default y
+   bool "include FIT"
+   default y if HAVE_TARGET_ROOTFS_INCLUDE_FIT
help
  This option might not apply to all targets. Make sure
  to check target/linux//image/Makefile to
  see if this option will have any effect.
 
+   endif # TARGET_ROOTFS_INCLUDE_KERNEL
+
+   config HAVE_TARGET_ROOTFS_INCLUDE_DTB
+   bool
+   default n
+
config TARGET_ROOTFS_INCLUDE_DTB
bool "Include DTB in root filesystem"
depends on USES_DEVICETREE && (TARGET_ROOTFS_UBIFS || 
TARGET_ROOTFS_EXT4FS)
-   default n
+   default y if HAVE_TARGET_ROOTFS_INCLUDE_DTB
help
- Include the device tree blob file(s) in the rootfs. Typically 
the DTBs
- are placed below /boot.
+ Include the device tree blob file(s) in the rootfs. Typically
+ the DTBs are placed below /boot.
 
 endmenu
diff --git a/target/linux/mxs/profiles/01-duckbill.mk 
b/target/linux/mxs/profiles/01-duckbill.mk
index 3f75a7a..ac3206d 100644
--- a/target/linux/mxs/profiles/01-duckbill.mk
+++ b/target/linux/mxs/profiles/01-duckbill.mk
@@ -7,8 +7,11 @@
 
 define Profile/duckbill
   NAME:=I2SE Duckbill boards
-  DEPENDS:=+@TARGET_ROOTFS_INCLUDE_KERNEL +@TARGET_ROOTFS_INCLUDE_DTB
   FEATURES+=usbgadget
+  OPTIONS:= \
+   HAVE_TARGET_ROOTFS_INCLUDE_KERNEL \
+   HAVE_TARGET_ROOTFS_INCLUDE_ZIMAGE \
+   HAVE_TARGET_ROOTFS_INCLUDE_DTB
   PACKAGES+= \
-dnsmasq -firewall -ppp -ip6tables -iptables -6relayd -mtd 
uboot-envtools \
kmod-leds-gpio kmod-ledtrig-timer kmod-usb-mxs-phy -kmod-ipt-nathelper
-- 
2.0.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel