Re: [OpenWrt-Devel] [PATCH] package/grub: fix stage2 link with recent binutils

2012-01-06 Thread Arnaud Lacombe
Hi,

On Mon, Dec 12, 2011 at 11:26 AM, Arnaud Lacombe  wrote:
> We want the `_start's symbols to be at the very beginning of the `stage2'
> binary's `.text' section. However, nothing enforces this requirement. With
> recent binutils (ie. post 2.19.1), this results in a corrupt binary, as ld(1)
> puts another symbol (eg. `journal_init') at the beginning of the section.
>
> Fix this by providing a stripped down version of the default linker script
> where we enforces the position of `_start' in the `.text' section.
>
> Signed-off-by: Arnaud Lacombe 
>
ping ?

Thanks,
 - Arnaud

> ---
>  .../grub/patches/030-add-stage2-ldscripts.patch    |   77 
> 
>  1 files changed, 77 insertions(+), 0 deletions(-)
>  create mode 100644 package/grub/patches/030-add-stage2-ldscripts.patch
>
> diff --git a/package/grub/patches/030-add-stage2-ldscripts.patch 
> b/package/grub/patches/030-add-stage2-ldscripts.patch
> new file mode 100644
> index 000..aff7ed4
> --- /dev/null
> +++ b/package/grub/patches/030-add-stage2-ldscripts.patch
> @@ -0,0 +1,77 @@
> +From 8858927ddc6797489cad322fc2d2134aeae543cd Mon Sep 17 00:00:00 2001
> +From: Arnaud Lacombe 
> +Date: Sun, 11 Dec 2011 16:44:02 -0500
> +Subject: [PATCH] add-stage2-ldscripts
> +
> +---
> + stage2/Makefile.am      |    2 +-
> + stage2/Makefile.in      |    2 +-
> + stage2/stage2.ldscripts |   30 ++
> + 3 files changed, 32 insertions(+), 2 deletions(-)
> + create mode 100644 stage2/stage2.ldscripts
> +
> +diff --git a/stage2/Makefile.am b/stage2/Makefile.am
> +index f8e6d42..ea28a4d 100644
> +--- a/stage2/Makefile.am
>  b/stage2/Makefile.am
> +@@ -55,7 +55,7 @@ noinst_PROGRAMS = pre_stage2.exec start.exec 
> start_eltorito.exec \
> + endif
> + MOSTLYCLEANFILES = $(noinst_PROGRAMS)
> +
> +-PRE_STAGE2_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8200
> ++PRE_STAGE2_LINK = -nostdlib -Wl,-N -Wl,-Tstage2.ldscripts
> + START_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8000
> + NBLOADER_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,0
> + PXELOADER_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,7C00
> +diff --git a/stage2/Makefile.in b/stage2/Makefile.in
> +index d0062bd..7bee2d5 100644
> +--- a/stage2/Makefile.in
>  b/stage2/Makefile.in
> +@@ -468,7 +468,7 @@ libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
> + @DISKLESS_SUPPORT_FALSE@noinst_DATA = pre_stage2 start start_eltorito
> + @DISKLESS_SUPPORT_TRUE@noinst_DATA = pre_stage2 start start_eltorito 
> nbloader pxeloader diskless
> + MOSTLYCLEANFILES = $(noinst_PROGRAMS)
> +-PRE_STAGE2_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8200
> ++PRE_STAGE2_LINK = -nostdlib -Wl,-N -Wl,-Tstage2.ldscripts
> + START_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8000
> + NBLOADER_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,0
> + PXELOADER_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,7C00
> +diff --git a/stage2/stage2.ldscripts b/stage2/stage2.ldscripts
> +new file mode 100644
> +index 000..2c8b8e1
> +--- /dev/null
>  b/stage2/stage2.ldscripts
> +@@ -0,0 +1,30 @@
> ++/* Script for -N: mix text and data on same page; don't align data */
> ++OUTPUT_FORMAT("elf32-i386", "elf32-i386",
> ++            "elf32-i386")
> ++OUTPUT_ARCH(i386)
> ++ENTRY(_start)
> ++SECTIONS
> ++{
> ++  . = 0x8200;
> ++  .text           :
> ++  {
> ++    _start = .;
> ++    *(.text .text.* )
> ++  }
> ++  .rodata         : { *(.rodata .rodata.* ) }
> ++  /* Adjust the address for the data segment.  We want to adjust up to
> ++     the same address within the page on the next page up.  */
> ++  . = .;
> ++  .data           : { *(.data .data.* ) }
> ++  __bss_start = .;
> ++  .bss            :
> ++  {
> ++   *(.bss .bss.* )
> ++   *(COMMON)
> ++   . = ALIGN(. != 0 ? 32 / 8 : 1);
> ++  }
> ++  . = ALIGN(32 / 8);
> ++  . = ALIGN(32 / 8);
> ++  _end = .; PROVIDE (end = .);
> ++  .comment       0 : { *(.comment) }
> ++}
> +--
> +1.7.6.153.g78432
> +
> --
> 1.7.6.153.g78432
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] package/kexec-tools: fix build with gcc 4.6.x

2012-01-06 Thread Arnaud Lacombe
Hi,

On Mon, Dec 12, 2011 at 11:25 AM, Arnaud Lacombe  wrote:
> This fixes the following build error:
>
> make[4]: Entering directory 
> `target-i386_gcc-4.6.1_binutils_2.21.1_uClibc-0.9.32/kexec-tools-2.0.2'
> mkdir -p purgatory
> i486-openwrt-linux-uclibc-gcc  --no-undefined -nostartfiles -nostdlib
>    -nodefaultlibs -e purgatory_start -r -o purgatory/purgatory.ro \
>    purgatory/purgatory.o purgatory/printf.o purgatory/string.o \
>    purgatory/arch/i386/entry32-16.o purgatory/arch/i386/entry32-16-debug.o \
>    purgatory/arch/i386/entry32.o purgatory/arch/i386/setup-x86.o \
>    purgatory/arch/i386/stack.o purgatory/arch/i386/compat_x86_64.o \
>    purgatory/arch/i386/purgatory-x86.o purgatory/arch/i386/console-x86.o \
>    purgatory/arch/i386/vga.o purgatory/arch/i386/pic.o \
>    purgatory/arch/i386/crashdump_backup.o purgatory/sha256.o \
> i486-openwrt-linux-uclibc-gcc: error: unrecognized option '--no-undefined'
>
> Original oatch from `kexec-tools' repository:
>
>    commit 8880e5b8a295788dcae8f5cc038de92cd97b6807
>    Author: Simon Horman 
>    Date:   Wed Mar 30 08:34:39 2011 +0900
>
>        build: Pass --no-undefined as a linker option
>
>        gcc-4.6 does not accept --no-undefined as a compiler option
>
>        Reported-by: Civil 
>        Acked-by: "Eric W. Biederman" 
>        Signed-off-by: Simon Horman 
>
> Signed-off-by: Arnaud Lacombe 
ping ?

Thanks,
 - Arnaud

> ---
>  ...uild-Pass-no-undefined-as-a-linker-option.patch |   32 
> 
>  1 files changed, 32 insertions(+), 0 deletions(-)
>  create mode 100644 
> package/kexec-tools/patches/0010-build-Pass-no-undefined-as-a-linker-option.patch
>
> diff --git 
> a/package/kexec-tools/patches/0010-build-Pass-no-undefined-as-a-linker-option.patch
>  
> b/package/kexec-tools/patches/0010-build-Pass-no-undefined-as-a-linker-option.patch
> new file mode 100644
> index 000..0384a03
> --- /dev/null
> +++ 
> b/package/kexec-tools/patches/0010-build-Pass-no-undefined-as-a-linker-option.patch
> @@ -0,0 +1,32 @@
> +From 8880e5b8a295788dcae8f5cc038de92cd97b6807 Mon Sep 17 00:00:00 2001
> +From: Simon Horman 
> +Date: Wed, 30 Mar 2011 08:34:39 +0900
> +Subject: [PATCH] build: Pass --no-undefined as a linker option
> +
> +gcc-4.6 does not accept --no-undefined as a compiler option
> +
> +Reported-by: Civil 
> +Acked-by: "Eric W. Biederman" 
> +Signed-off-by: Simon Horman 
> +---
> + purgatory/Makefile |    4 ++--
> + 1 files changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/purgatory/Makefile b/purgatory/Makefile
> +index ea0c19a..ee1679c 100644
> +--- a/purgatory/Makefile
>  b/purgatory/Makefile
> +@@ -56,8 +56,8 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
> +                       -I$(srcdir)/include \
> +                       -I$(shell $(CC) -print-file-name=include)
> + $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
> +-                      --no-undefined -nostartfiles -nostdlib -nodefaultlibs 
> \
> +-                      -e purgatory_start -r
> ++                      -Wl,--no-undefined -nostartfiles -nostdlib \
> ++                      -nodefaultlibs -e purgatory_start -r
> +
> + $(PURGATORY): $(PURGATORY_OBJS)
> +       $(MKDIR) -p $(@D)
> +--
> +1.7.8.rc3.51.g86536f
> +
> --
> 1.7.6.153.g78432
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] kexec failure on G300NH

2012-01-06 Thread Peter Naulls

On 01/06/2012 08:10 AM, Peter Naulls wrote:


As an alternative, I'm looking at first jumping to an ar71xx version
of u-boot (as per OpenWrt build), all I should need to add to that
is flash support for the G300NH(2). Perhaps that puts the system
in more consistent state before starting Linux.


I was able to make this work.  I built the ar71xx u-boot, and
was able to add support for the G300NH flash.  So, I kexec
into u-boot, then am able to reboot back into Linux (loaded
from flash).  This suggests that u-boot is resetting something
that either kexec or the Linux kernel upon boot does not.

Anyway, I'll pursue this option right now, but I'm open ideas
for fixing kexec directly to new kernel.

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


Re: [OpenWrt-Devel] Makefile: problem with configurable library dependency

2012-01-06 Thread Jan Chybiak

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Strange! If I use

DEPENDS:=mylib

instead of

DEPENDS:=MYPACKAGE_USES_LIBRARY:mylib

the opkg dependency works, even without PKG_BUILD_DEPENDS (as Jo-Philipp
mentioned).

Is that a bug or is there another way to realize a configurable dependency?

Cheers,

jan

Am 06.01.2012 21:43, schrieb Jan Chybiak:
>
> Hi Jo-Philipp,
>
> thanks for the reply. Unfortunately that does not work either. The
result is the same as with omitting the + sign.
> The package gets built but the dependency is not passed on to opkg
therefore still installing the package without
> the necessary library.
>
> Further I explicitely have to add PKG_BUILD_DEPENDS to make the build
trigger the library build. Omitting
> it builds just the package.
>
> Btw: Having the library dependency in the bool option lets me set the
dependency only if the library itself has
> been selected, making it therefore unnecessary to add the + sign to
DEPENDS.
>
> Maybe one more point is, that the package is resided in the package
directory while the library has been added via feeds/packages. Can that
be a problem?
>
>
>
> Am 06.01.2012 02:41, schrieb Jo-Philipp Wich:
> > Hi.
>
> > Use "DEPENDS:=+CONFIG_MYPACKAGE_USES_LIBRARY:mylib" (the plus in front).
> > That will also make the PKG_BUILD_DEPENDS unnecessary.
>
> > Adding a plus in front of a dependency spec means your package selects
> > the dependant package and it is also propagated as opkg dependency.
>
> > ~ Jow
> > ___
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iEYEARECAAYFAk8HYjgACgkQh655pvNJE5ASlwCglzS0zVyQDRKxI7OqOsFXCvN5
nM4An3qFd5LsDcutRCm+2FRtkyeOlgmg
=Up3s
-END PGP SIGNATURE-

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


Re: [OpenWrt-Devel] Makefile: problem with configurable library dependency

2012-01-06 Thread Jan Chybiak

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Hi Jo-Philipp,

thanks for the reply. Unfortunately that does not work either. The
result is the same as with omitting the + sign.
The package gets built but the dependency is not passed on to opkg
therefore still installing the package without
the necessary library.

Further I explicitely have to add PKG_BUILD_DEPENDS to make the build
trigger the library build. Omitting
it builds just the package.

Btw: Having the library dependency in the bool option lets me set the
dependency only if the library itself has
been selected, making it therefore unnecessary to add the + sign to DEPENDS.

Maybe one more point is, that the package is resided in the package
directory while the library has been added via feeds/packages. Can that
be a problem?



Am 06.01.2012 02:41, schrieb Jo-Philipp Wich:
> Hi.
>
> Use "DEPENDS:=+CONFIG_MYPACKAGE_USES_LIBRARY:mylib" (the plus in front).
> That will also make the PKG_BUILD_DEPENDS unnecessary.
>
> Adding a plus in front of a dependency spec means your package selects
> the dependant package and it is also propagated as opkg dependency.
>
> ~ Jow
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iEYEARECAAYFAk8HXOUACgkQh655pvNJE5BZvQCglOZVe/diT6ogdz2jaWG32u8+
YVUAn10bgLsIjkxtCFKmi2mmOtkN9T9A
=4GoK
-END PGP SIGNATURE-

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


Re: [OpenWrt-Devel] /dev/watchdog from shell script

2012-01-06 Thread Stefan Monnier
> I did this on my boxes, but it does not help.
> Again a device is _pingable_, but all daemons are
> not responding anymore:

So either:
- watchdog was killed and this just disabled the watchdog timer altogether.
- watchdog was not killed for some reason (e.g. because the kernel
  considered that it holds on to some important resource).


Stefan

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


Re: [OpenWrt-Devel] kexec failure on G300NH

2012-01-06 Thread Peter Naulls

On 01/06/2012 02:48 AM, Florian Fainelli wrote:



Then this might be an entirely different issue. Try to run the kexec'd kernel
uncached and see if that helps (there is a MIPS-specific Kconfig option to do
that).


CONFIG_MIPS_L1_CACHE_SHIFT=5 ?  There's other related stuff in
arch/mips/Kconfig but I don't see an explicit disable.

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


Re: [OpenWrt-Devel] kexec failure on G300NH

2012-01-06 Thread Peter Naulls

On 01/06/2012 07:06 AM, Paolo Pisati wrote:

On 01/06/2012 11:48 AM, Florian Fainelli wrote:


Then this might be an entirely different issue. Try to run the kexec'd
kernel uncached and see if that helps (there is a MIPS-specific Kconfig
option to do that).


but is kexec working at all on MIPS cpus? on arm, at least, it was badly
broken and there are fixes queued for the 3.3 window.


Not all.  It does appear to work fine, above issues notwithstanding.
However, I need it to also work on ramips, where it has issues.  I'll
be looking at that in detail once I fix this.

As an alternative, I'm looking at first jumping to an ar71xx version
of u-boot (as per OpenWrt build), all I should need to add to that
is flash support for the G300NH(2).  Perhaps that puts the system
in more consistent state before starting Linux.



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


Re: [OpenWrt-Devel] kexec failure on G300NH

2012-01-06 Thread Paolo Pisati
On 01/06/2012 11:48 AM, Florian Fainelli wrote:
> 
> Then this might be an entirely different issue. Try to run the kexec'd
> kernel uncached and see if that helps (there is a MIPS-specific Kconfig
> option to do that).

but is kexec working at all on MIPS cpus? on arm, at least, it was badly
broken and there are fixes queued for the 3.3 window.

-- 
bye,
p.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] kexec failure on G300NH

2012-01-06 Thread Florian Fainelli

On 01/05/12 23:19, Peter Naulls wrote:

On 01/05/2012 09:43 AM, Florian Fainelli wrote:

Hello,


You should enable kernel debugging in your kexec'd kernel and see 
whether the

serial port is being left with IRQs disabled from the original kernel.


I turned on kernel debug, but I'm unsure what exactly I'm looking at.


Look for unhandled IRQs which should lead to the message "irq  nobody 
cared" if this is the cause of the problem.




It may be that the serial port is flooding the kernel with IRQs not 
handled

which in turn causes a reboot.

Otherwise, just dump the serial port register contents before leaving 
the
original kernel, and at driver initialization of the kexec'd kernel 
to see if

there are any differences.


Sure, but which registers am I looking at - 8250, or something arxx 
specific?


8250 registers, which are memory-mapped into the CPU address space.



I went as far as to set:

CONFIG_SERIAL_8250_NR_UARTS=0
CONFIG_SERIAL_8250_RUNTIME_UARTS=0

But this might not be enough by itself.  It still reboots at that same
point.  I also tried disabling early printk.


Then this might be an entirely different issue. Try to run the kexec'd 
kernel uncached and see if that helps (there is a MIPS-specific Kconfig 
option to do that).

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


[OpenWrt-Devel] ar71xx: local mac support on the wndr3700?

2012-01-06 Thread Dave Taht
On Thu, Jan 5, 2012 at 10:09 PM, Gabor Juhos  wrote:
> Please remove the ar71xx_eth{0,1}_data.* initialization. Those values are
> configured automatically for AR7240 since r29103.

I have been carrying this patch (of yours?) forward for a while,
in order to get routable ethernet interfaces on the wndr3700 and
wndr3800. Am I doing it in the right place?

One thing I've noticed on my recent builds (3.1.6) is that hostapd
eats cpu when the wireless is not in use, and the wired interface
is being loaded up. (top shows a hostapd eating up to 40% of
cpu while I'm doing a big transfer over the two ethernet interfaces
- and my transfer rates have dropped since I last did benchmarking)

I've been doing debugging on other quarters, but perhaps
this is significant, or another problem... The mac address DOES
show up as changed, but maybe the driver or hostapd is confused?

[PATCH 4/4] Add local mac support to wndr3700 so as to be able to
route not bridge

The wndr3700 at least has no eth0 mac address and usually leverages
the first wireless device's mac when in a bridged scenario. If,
however, you want to route, and not bridge the interfaces, you
need a unique mac address for it.

This patch sets the local bit on the mac address pulled from the
wireless chip and uses the resulting address for eth0.
---
 .../ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c  |   15 +--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
index cfd0ba9..c708b97 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
@@ -111,12 +111,23 @@ static struct platform_device wndr3700_rtl8366s_device = {
}
 };

+/*
+ * The eth0 and wmac0 interfaces share the same MAC address which
+ * can lead to problems if operated unbridged. Set the locally
+ * administered bit on the eth0 MAC to make it unique.
+ */
+
+static void __init wndr3700_init_local_mac(unsigned char *mac_base)
+{
+   ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac_base, 0);
+   ar71xx_eth0_data.mac_addr[0] |= 0x02;
+}
+
 static void __init wndr3700_setup(void)
 {
u8 *art = (u8 *) KSEG1ADDR(0x1fff);

-   ar71xx_init_mac(ar71xx_eth0_data.mac_addr,
-   art + WNDR3700_ETH0_MAC_OFFSET, 0);
+   wndr3700_init_local_mac(art + WNDR3700_ETH0_MAC_OFFSET);
ar71xx_eth0_pll_data.pll_1000 = 0x;
ar71xx_eth0_data.mii_bus_dev = &wndr3700_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
-- 
1.7.1


-- 
Dave Täht
SKYPE: davetaht
US Tel: 1-239-829-5608
FR Tel: 0638645374
http://www.bufferbloat.net
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel