[OpenWrt-Devel] [PATCH] flexible kernel mtd size for orion_generic targets

2012-04-06 Thread Matthias Buecher / Germany
Add an image option for the Orion Generic targets, that allows to
specify the kernel mtd partition size.
The option takes care for necessary size extension when building with
symbols.
The value is also used for image generation (padding).

Plus:
- creation of ARM uImage generalized in image makefile
- sanitizing pathes in image makefile
- rebase of "300-dns323_partition_map.patch" for current 3.0.18 kernel

Signed-off-by: Matthias Bücher 


Patch is attached to prevent mail mangling and inline for comments:

Index: target/linux/orion/image/Config.in
===
--- target/linux/orion/image/Config.in  (revision 0)
+++ target/linux/orion/image/Config.in  (revision 0)
@@ -0,0 +1,18 @@
+config KERNEL_OPENWRT_KERNEL_MTD_SIZE
+   int
+   prompt "Kernel MTD partition size in KiB (512 - 2048 in steps of 128)"
+   range 512 2048
+   depends TARGET_orion
+   default 1152 if TARGET_orion_generic && KERNEL_KALLSYMS
+   default 1024 if TARGET_orion_generic
+   default 1536 if TARGET_orion_dns323
+   help
+   Defines the size of the kernel's MTD partition in KiB (1 KiB = 
1024
bytes).
+   This value is used in the device patches for defining the MTD 
partitions.
+   Make sure that all patches for all devices make use of this 
value.
+   The value is also used in the image file for correct padding 
and more.
+   It is recommended to choose a size in 128KiB steps (biggest 
erase size,
+   e.g. Netgear WNR854T).
+   Orion Generic target:
+ Before kernel 2.6.35: 1024KiB for all
+  Since kernel 2.6.35: 1152KiB for kernel with symbols
Index: target/linux/orion/patches/020-flexible_kernel_mtd_size.patch
===
--- target/linux/orion/patches/020-flexible_kernel_mtd_size.patch
(revision 0)
+++ target/linux/orion/patches/020-flexible_kernel_mtd_size.patch
(revision 0)
@@ -0,0 +1,16 @@
+--- a/arch/arm/mach-orion5x/Kconfig
 b/arch/arm/mach-orion5x/Kconfig
+@@ -155,6 +155,13 @@ config MACH_RD88F6183AP_GE
+ Say 'Y' here if you want your kernel to support the
+ Marvell Orion-1-90 (88F6183) AP GE RD.
+
++config OPENWRT_KERNEL_MTD_SIZE
++  int
++  prompt "OpenWrt hack: Kernel MTD partition size in KiB"
++  default 1024
++  help
++  Defines the size of the kernel's MTD partition in KiB (1 KiB = 
1024
bytes).
++  This is just a help construct for OpenWrt to pass a value to the
kernel build process.
+ endmenu
+
+ endif
Index: target/linux/orion/patches/100-wrt350nv2_openwrt_partition_map.patch
===
---
target/linux/orion/patches/100-wrt350nv2_openwrt_partition_map.patch
(revision 31201)
+++
target/linux/orion/patches/100-wrt350nv2_openwrt_partition_map.patch
(working copy)
@@ -5,13 +5,13 @@
.name   = "kernel",
.offset = 0x,
 -  .size   = 0x0076,
-+  .size   = 0x0010,   // change to kernel mtd size 
here (1/3)
++  .size   = (CONFIG_OPENWRT_KERNEL_MTD_SIZE * 1024),  
// original was
0x001A (1664KiB)
}, {
.name   = "rootfs",
 -  .offset = 0x001a,
 -  .size   = 0x005c,
-+  .offset = 0x0010,   // change to kernel mtd size 
here (2/3)
-+  .size   = 0x0065,   // adopt to kernel mtd size 
here (3/3) =
0x0075 - 
++  .offset = (CONFIG_OPENWRT_KERNEL_MTD_SIZE * 1024),  
// original was
0x001A (1664KiB)
++  .size   = (0x0075 - (CONFIG_OPENWRT_KERNEL_MTD_SIZE 
* 1024)),   //
exclude area with eRcOmM signature
}, {
.name   = "lang",
.offset = 0x0076,
Index: target/linux/orion/patches/101-wnr854t_partition_map.patch
===
--- target/linux/orion/patches/101-wnr854t_partition_map.patch  (revision
31201)
+++ target/linux/orion/patches/101-wnr854t_partition_map.patch  (working
copy)
@@ -1,6 +1,18 @@
 --- a/arch/arm/mach-orion5x/wnr854t-setup.c
 +++ b/arch/arm/mach-orion5x/wnr854t-setup.c
-@@ -67,6 +67,10 @@ static struct mtd_partition wnr854t_nor_
+@@ -58,15 +58,19 @@ static struct mtd_partition wnr854t_nor_
+   {
+   .name   = "kernel",
+   .offset = 0x,
+-  .size   = 0x0010,
++  .size   = (CONFIG_OPENWRT_KERNEL_MTD_SIZE * 1024),
+   }, {
+   .name   = "rootfs",
+-  .offset = 0x0010,
+-  .size   = 0x0066,
++  .offset = (CONFIG_OPENWRT_KERNEL_MTD_SIZE * 1024),

Re: [OpenWrt-Devel] [PATCH] flexible kernel mtd size for orion_generic targets

2012-04-07 Thread Imre Kaloz
On Fri, 06 Apr 2012 18:31:13 +0200, Matthias Buecher / Germany  
 wrote:



Add an image option for the Orion Generic targets, that allows to
specify the kernel mtd partition size.
The option takes care for necessary size extension when building with
symbols.
The value is also used for image generation (padding).




As I've told this before, I can't accept the idea nor the design. If you  
need a kernel with more things compiled in for testing, you can tftpboot  
it and you won't be limited by the partitions.



Imre
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] flexible kernel mtd size for orion_generic targets

2012-04-08 Thread Matthias Buecher / Germany
http://patchwork.openwrt.org/patch/2046/

On 06.04.2012 18:31, Matthias Buecher / Germany wrote:
> Add an image option for the Orion Generic targets, that allows to
> specify the kernel mtd partition size.
> The option takes care for necessary size extension when building with
> symbols.
> The value is also used for image generation (padding).
> 
> Plus:
> - creation of ARM uImage generalized in image makefile
> - sanitizing pathes in image makefile
> - rebase of "300-dns323_partition_map.patch" for current 3.0.18 kernel
> 
> Signed-off-by: Matthias Bücher 
> 
> 
> Patch is attached to prevent mail mangling and inline for comments:
> 
> Index: target/linux/orion/image/Config.in
> ===
> --- target/linux/orion/image/Config.in(revision 0)
> +++ target/linux/orion/image/Config.in(revision 0)
> @@ -0,0 +1,18 @@
> +config KERNEL_OPENWRT_KERNEL_MTD_SIZE
> + int
> + prompt "Kernel MTD partition size in KiB (512 - 2048 in steps of 128)"
> + range 512 2048
> + depends TARGET_orion
> + default 1152 if TARGET_orion_generic && KERNEL_KALLSYMS
> + default 1024 if TARGET_orion_generic
> + default 1536 if TARGET_orion_dns323
> + help
> + Defines the size of the kernel's MTD partition in KiB (1 KiB = 
> 1024
> bytes).
> + This value is used in the device patches for defining the MTD 
> partitions.
> + Make sure that all patches for all devices make use of this 
> value.
> + The value is also used in the image file for correct padding 
> and more.
> + It is recommended to choose a size in 128KiB steps (biggest 
> erase size,
> + e.g. Netgear WNR854T).
> + Orion Generic target:
> +   Before kernel 2.6.35: 1024KiB for all
> +Since kernel 2.6.35: 1152KiB for kernel with symbols
> Index: target/linux/orion/patches/020-flexible_kernel_mtd_size.patch
> ===
> --- target/linux/orion/patches/020-flexible_kernel_mtd_size.patch
> (revision 0)
> +++ target/linux/orion/patches/020-flexible_kernel_mtd_size.patch
> (revision 0)
> @@ -0,0 +1,16 @@
> +--- a/arch/arm/mach-orion5x/Kconfig
>  b/arch/arm/mach-orion5x/Kconfig
> +@@ -155,6 +155,13 @@ config MACH_RD88F6183AP_GE
> +   Say 'Y' here if you want your kernel to support the
> +   Marvell Orion-1-90 (88F6183) AP GE RD.
> +
> ++config OPENWRT_KERNEL_MTD_SIZE
> ++int
> ++prompt "OpenWrt hack: Kernel MTD partition size in KiB"
> ++default 1024
> ++help
> ++Defines the size of the kernel's MTD partition in KiB (1 KiB = 
> 1024
> bytes).
> ++This is just a help construct for OpenWrt to pass a value to the
> kernel build process.
> + endmenu
> +
> + endif
> Index: target/linux/orion/patches/100-wrt350nv2_openwrt_partition_map.patch
> ===
> ---
> target/linux/orion/patches/100-wrt350nv2_openwrt_partition_map.patch
> (revision 31201)
> +++
> target/linux/orion/patches/100-wrt350nv2_openwrt_partition_map.patch
> (working copy)
> @@ -5,13 +5,13 @@
>   .name   = "kernel",
>   .offset = 0x,
>  -.size   = 0x0076,
> -+.size   = 0x0010,   // change to kernel mtd size 
> here (1/3)
> ++.size   = (CONFIG_OPENWRT_KERNEL_MTD_SIZE * 1024),  
> // original was
> 0x001A (1664KiB)
>   }, {
>   .name   = "rootfs",
>  -.offset = 0x001a,
>  -.size   = 0x005c,
> -+.offset = 0x0010,   // change to kernel mtd size 
> here (2/3)
> -+.size   = 0x0065,   // adopt to kernel mtd size 
> here (3/3) =
> 0x0075 - 
> ++.offset = (CONFIG_OPENWRT_KERNEL_MTD_SIZE * 1024),  
> // original was
> 0x001A (1664KiB)
> ++.size   = (0x0075 - (CONFIG_OPENWRT_KERNEL_MTD_SIZE 
> * 1024)),   //
> exclude area with eRcOmM signature
>   }, {
>   .name   = "lang",
>   .offset = 0x0076,
> Index: target/linux/orion/patches/101-wnr854t_partition_map.patch
> ===
> --- target/linux/orion/patches/101-wnr854t_partition_map.patch
> (revision
> 31201)
> +++ target/linux/orion/patches/101-wnr854t_partition_map.patch(working
> copy)
> @@ -1,6 +1,18 @@
>  --- a/arch/arm/mach-orion5x/wnr854t-setup.c
>  +++ b/arch/arm/mach-orion5x/wnr854t-setup.c
> -@@ -67,6 +67,10 @@ static struct mtd_partition wnr854t_nor_
> +@@ -58,15 +58,19 @@ static struct mtd_partition wnr854t_nor_
> + {
> + .name   = "kernel",
> + .offset = 0x,
> +-.size   = 0x0010,
> ++.size 

Re: [OpenWrt-Devel] [PATCH] flexible kernel mtd size for orion_generic targets

2012-04-08 Thread Matthias Buecher / Germany
On 07.04.2012 20:28, Imre Kaloz wrote:
> On Fri, 06 Apr 2012 18:31:13 +0200, Matthias Buecher / Germany
>  wrote:
> 
>> Add an image option for the Orion Generic targets, that allows to
>> specify the kernel mtd partition size.
>> The option takes care for necessary size extension when building with
>> symbols.
>> The value is also used for image generation (padding).
> 
> 
> 
> As I've told this before, I can't accept the idea nor the design. If you
> need a kernel with more things compiled in for testing, you can tftpboot
> it and you won't be limited by the partitions.
> 
> Imre

Hello Imre,

it's not about flashing a kernel with more modules integrated for me.

It's about a normal image with symbols for others. It takes a lot of
time to explain someone on the forum or in mails what and how to get a
working image with symbols, just to get an oops report with symbols.
(With a kernel plus symbols nbd could find an alignment error and he
told me there will be more not yet found.)
The solution is very simple and clean, plus everybody can build an image
with symbols without any source changes, compilation issues or runtime
issues.
While others want to build an even smaller image than the default one
due to their special demands.

Of course it would be much easier to give the mtd partitions via the
kernel command line just like it is done for ar71xx targets. But I do
not have the knowledge to develop this for all Orion targets, also I do
not have the devices to test (although Nilfred would be willing to
sacrifice his WNR854T).

Another solution for different kernel sizes would be to use a dynamic
mtd partition uImage split similar as it is done for Lantiq targets. I
already created the code for this, which could even go into the generic
patches as it doesn't have the logic errors of the Lantiq targets.

It would be great if there would be a solution for this on Orion, but
also a general OpenWrt way would help lots of people willing to help on
oops reports and willing to contribute.
Any help is greatly appreciated.

Regards
Maddes
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel