Re: [OpenWrt-Devel] Sysupgrade x86 bounty

2012-04-13 Thread David Woodhouse
For a start, this isn't really about x86, is it? It's about systems
which use block-based storage instead of flash?

This is for anything which makes the mistake of using CompactFlash or SD
instead of letting the OS have real access to the flash.

There are x86 systems (like OLPCv1, anything with a DiskOnChip, etc.)
with real flash, and there are non-x86 systems which unfortunately use
SD. Although perhaps OpenWrt hasn't reached the latter yet.

So whatever the solution, it *shouldn't* be specific to the x86 target,
surely?

On Thu, 2012-04-12 at 22:28 -0400, Adam Gensler wrote:
 When it is time to upgrade the image, the inactive rootfs partition 
 would be the one upgraded. /dev/sda1 would be mounted, the correct 
 kernel overwritten, and menu.lst updated to default to the new kernel.

Sounds like you'd be a lot better off using btrfs snapshots for that.

Take a snapshot before upgrade, mount that snapshot and untar the new
system image into it. Then reboot mounting that snapshot as root.

(Remember, in btrfs snapshots are more like branches; they're writeable
and the 'master' is just another snapshot that happens to be the one
that gets mounted by default when you don't specify otherwise.)

-- 
dwmw2


smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Sysupgrade x86 bounty

2012-04-13 Thread David Woodhouse
On Fri, 2012-04-13 at 10:24 +0100, David Woodhouse wrote:
 Sounds like you'd be a lot better off using btrfs snapshots for that.

Note that btrfs-progs from the git tree now has a '-r' option to create
an image from a given directly, much like genext2fs does.

-- 
dwmw2


smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] Initial support for Tenda W306R V2.0

2012-04-13 Thread David P
More device info at: http://wiki.openwrt.org/toh/tenda/w306r

Index: target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig
===
--- target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig   (revision 31231)
+++ target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig   (working copy)
@@ -104,6 +104,11 @@
select RALINK_DEV_GPIO_BUTTONS
select RALINK_DEV_GPIO_LEDS
 
+config RT305X_MACH_W306R_V20
+   bool Tenda W306R V2.0 board support
+   select RALINK_DEV_GPIO_BUTTONS
+   select RALINK_DEV_GPIO_LEDS
+
 config RT305X_MACH_WL341V3
bool Sitecom WL-341 v3 board support
select RALINK_DEV_GPIO_BUTTONS
Index: target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile
===
--- target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile  (revision 31231)
+++ target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile  (working copy)
@@ -29,6 +29,7 @@
 obj-$(CONFIG_RT305X_MACH_RT_N10_PLUS)  += mach-rt-n10-plus.o
 obj-$(CONFIG_RT305X_MACH_SL_R7205) += mach-sl-r7205.o
 obj-$(CONFIG_RT305X_MACH_V22RW_2X2)+= mach-v22rw-2x2.o
+obj-$(CONFIG_RT305X_MACH_W306R_V20)+= mach-w306r-v20.o
 obj-$(CONFIG_RT305X_MACH_W502U)+= mach-w502u.o
 obj-$(CONFIG_RT305X_MACH_WCR150GN) += mach-wcr150gn.o
 obj-$(CONFIG_RT305X_MACH_WHR_G300N)+= mach-whr-g300n.o
Index: target/linux/ramips/files/arch/mips/ralink/rt305x/mach-w306r-v20.c
===
--- target/linux/ramips/files/arch/mips/ralink/rt305x/mach-w306r-v20.c  
(revision 0)
+++ target/linux/ramips/files/arch/mips/ralink/rt305x/mach-w306r-v20.c  
(revision 0)
@@ -0,0 +1,70 @@
+/*
+ *  Tenda W306R V2.0 board support
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/ethtool.h
+
+#include asm/mach-ralink/machine.h
+#include asm/mach-ralink/dev-gpio-buttons.h
+#include asm/mach-ralink/dev-gpio-leds.h
+#include asm/mach-ralink/rt305x.h
+#include asm/mach-ralink/rt305x_regs.h
+#include asm/mach-ralink/ramips_eth_platform.h
+
+#include devices.h
+
+#define W306R_V20_GPIO_LED_SYS a9
+#define W306R_V20_GPIO_LED_WPS 13
+
+#define W306R_V20_GPIO_BUTTON_RESET10
+
+#define W306R_V20_KEYS_POLL_INTERVAL   20
+#define W306R_V20_KEYS_DEBOUNCE_INTERVAL   (3 * 
W306R_V20_KEYS_POLL_INTERVAL)
+
+static struct gpio_led w306r_v20_leds_gpio[] __initdata = {
+   {
+   .name   = w306r-v20:green:sys,
+   .gpio   = W306R_V20_GPIO_LED_SYS,
+   .active_low = 1,
+   }, {
+   .name   = w306r-v20:green:wps,
+   .gpio   = W306R_V20_GPIO_LED_WPS,
+   .active_low = 1,
+   }
+};
+
+static struct gpio_keys_button w306r_v20_gpio_buttons[] __initdata = {
+   {
+   .desc   = RESET/WPS,
+   .type   = EV_KEY,
+   .code   = KEY_RESTART,
+   .debounce_interval = W306R_V20_KEYS_DEBOUNCE_INTERVAL,
+   .gpio   = W306R_V20_GPIO_BUTTON_RESET,
+   .active_low = 1,
+   }
+};
+static void __init w306r_v20_init(void)
+{
+   rt305x_register_flash(0);
+   
+   rt305x_gpio_init(RT305X_GPIO_MODE_GPIO  RT305X_GPIO_MODE_UART0_SHIFT);
+
+   rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_W;
+   rt305x_register_ethernet();
+   ramips_register_gpio_leds(-1, ARRAY_SIZE(w306r_v20_leds_gpio),
+ w306r_v20_leds_gpio);
+   ramips_register_gpio_buttons(-1, W306R_V20_KEYS_POLL_INTERVAL,
+ARRAY_SIZE(w306r_v20_gpio_buttons),
+w306r_v20_gpio_buttons);
+   rt305x_register_wifi();
+   rt305x_register_wdt();
+}
+
+MIPS_MACHINE(RAMIPS_MACH_W306R_V20, W306R_V20, Tenda W306R V2.0, 
w306r_v20_init);
Index: target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
===
--- target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h   
(revision 31231)
+++ target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h   
(working copy)
@@ -45,6 +45,7 @@
RAMIPS_MACH_PWH2004,/* Prolink 2004H / Abocom 5205 */
RAMIPS_MACH_SL_R7205,   /* Skylink SL-R7205 Wireless 3G Router*/
RAMIPS_MACH_V22RW_2X2,  /* Ralink AP-RT3052-V22RW-2X2 */
+   RAMIPS_MACH_W306R_V20,  /* Tenda W306R_V20 */
RAMIPS_MACH_W502U,  /* ALFA Networks W502U */
RAMIPS_MACH_WCR150GN,   /* Sparklan WCR-150GN */

Re: [OpenWrt-Devel] Sysupgrade x86 bounty

2012-04-13 Thread Kaspar Schleiser

Hey,

well, and it only affects those installations that use ext4.
Using sqashfs and jffs2 is perfectly possibly on block devices. 
Sysupgrade works fine with them on x86.


Regards
Kaspar

On 04/13/2012 11:24 AM, David Woodhouse wrote:

For a start, this isn't really about x86, is it? It's about systems
which use block-based storage instead of flash?

This is for anything which makes the mistake of using CompactFlash or SD
instead of letting the OS have real access to the flash.

There are x86 systems (like OLPCv1, anything with a DiskOnChip, etc.)
with real flash, and there are non-x86 systems which unfortunately use
SD. Although perhaps OpenWrt hasn't reached the latter yet.

So whatever the solution, it *shouldn't* be specific to the x86 target,
surely?

On Thu, 2012-04-12 at 22:28 -0400, Adam Gensler wrote:

When it is time to upgrade the image, the inactive rootfs partition
would be the one upgraded. /dev/sda1 would be mounted, the correct
kernel overwritten, and menu.lst updated to default to the new kernel.


Sounds like you'd be a lot better off using btrfs snapshots for that.

Take a snapshot before upgrade, mount that snapshot and untar the new
system image into it. Then reboot mounting that snapshot as root.

(Remember, in btrfs snapshots are more like branches; they're writeable
and the 'master' is just another snapshot that happens to be the one
that gets mounted by default when you don't specify otherwise.)




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

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


Re: [OpenWrt-Devel] Sysupgrade x86 bounty

2012-04-13 Thread Adam Gensler
Not entirely. If you do sysupgrade -n, even with a squashfs image, the 
image isn't actually upgraded. The upgrade process skips writing the 
image file and proceeds with a reboot without having done anything.



On 4/13/12 8:03 AM, Kaspar Schleiser wrote:

Hey,

well, and it only affects those installations that use ext4.
Using sqashfs and jffs2 is perfectly possibly on block devices.
Sysupgrade works fine with them on x86.

Regards
Kaspar

On 04/13/2012 11:24 AM, David Woodhouse wrote:

For a start, this isn't really about x86, is it? It's about systems
which use block-based storage instead of flash?

This is for anything which makes the mistake of using CompactFlash or SD
instead of letting the OS have real access to the flash.

There are x86 systems (like OLPCv1, anything with a DiskOnChip, etc.)
with real flash, and there are non-x86 systems which unfortunately use
SD. Although perhaps OpenWrt hasn't reached the latter yet.

So whatever the solution, it *shouldn't* be specific to the x86 target,
surely?

On Thu, 2012-04-12 at 22:28 -0400, Adam Gensler wrote:

When it is time to upgrade the image, the inactive rootfs partition
would be the one upgraded. /dev/sda1 would be mounted, the correct
kernel overwritten, and menu.lst updated to default to the new kernel.


Sounds like you'd be a lot better off using btrfs snapshots for that.

Take a snapshot before upgrade, mount that snapshot and untar the new
system image into it. Then reboot mounting that snapshot as root.

(Remember, in btrfs snapshots are more like branches; they're writeable
and the 'master' is just another snapshot that happens to be the one
that gets mounted by default when you don't specify otherwise.)




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

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

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


[OpenWrt-Devel] [PATCH] Make kernel version configurable for developers

2012-04-13 Thread Jeroen van Bemmel
A grep for LINUX_VERSION in target/linux/*/Makefile shows that OpenWRT 
current uses a large number of different kernel versions for the various 
platforms. While there may be reasons for using a particular version, it 
would be nice if newer kernels were available for those platforms that 
support them. Ideally, most platforms would use the same, latest stable 
Linux kernel version


This patch makes it easier for developers to generate an image using a 
specific Linux kernel version. It adds a configuration option to the 
Developer menu, selecting the latest stable kernel (3.3.2) by default to 
stimulate experimentation with this version. Device profiles may select 
a specific kernel version as default by declaring a pseudo-module 
kernel-x.y.z as default (strings to be added to Config.in as needed)


The patch updates the Makefile for brcm63xx to enable a kernel version 
override; other Makefiles will need to be patched in a similar way. 
Nothing is changed unless a developer explicitly selects the new option 
in the menu


Signed-off-by: Jeroen van Bemmel jbem...@zonnet.nl

Index: Config.in
===
--- Config.in(revision 31276)
+++ Config.in(working copy)
@@ -458,6 +458,20 @@
   in the package directory, pointing to the .git tree that you 
want

   to pull the source code from

+config CHOOSE_KERNEL_VERSION
+bool Select a specific Linux kernel version to build if DEVEL
+default n
+help
+  Enable this to build a specific Linux kernel version. Useful 
for testing newer kernels

+
+config KERNEL_VERSION
+string Linux kernel version to build (default = latest 
stable) if CHOOSE_KERNEL_VERSION  DEVEL

+default 3.3.1 if DEFAULT_kernel-3.3.1
+default 3.3.2
+depends CHOOSE_KERNEL_VERSION
+help
+  Linux kernel version to build. Defaults to the latest stable 
kernel, if not set as a pseudo-module in a specific device profile

+
 menuconfig TARGET_OPTIONS
 bool Target Options  if DEVEL

Index: target/linux/brcm63xx/Makefile
===
--- target/linux/brcm63xx/Makefile(revision 31276)
+++ target/linux/brcm63xx/Makefile(working copy)
@@ -10,7 +10,14 @@
 BOARD:=brcm63xx
 BOARDNAME:=Broadcom BCM63xx
 FEATURES:=squashfs jffs2 usb atm pci pcmcia
-LINUX_VERSION:=3.0.18
+
+# Allow override of kernel version by menuconfig
+ifdef CONFIG_KERNEL_VERSION
+ LINUX_VERSION:=$(subst ,,$(CONFIG_KERNEL_VERSION))
+else
+ LINUX_VERSION:=3.0.18
+endif
+
 MAINTAINER:=Florian Fainelli flor...@openwrt.org

 include $(INCLUDE_DIR)/target.mk


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


[OpenWrt-Devel] [PATCH] usbip: update userspace to match kernel part

2012-04-13 Thread Abaakouk Mehdi

After kernel 2.6.39, usbip kernel and userspace are in kernel tree
The new kernel modules names have already been updated in openwrt for 
kernel  2.6.39


This patch, allow to build the new corresponding usbip userspace tool 
when of the device use a kernel  2.6.39

And continue to build version 0.1.7 for older version.

Fix #10992

Signed-off-by: Mehdi Abaakouk sil...@sileht.net

Index: net/usbip/Makefile
===
--- net/usbip/Makefile  (révision 31217)
+++ net/usbip/Makefile  (copie de travail)
@@ -9,13 +9,35 @@
 include $(INCLUDE_DIR)/kernel.mk

 PKG_NAME:=usbip
-PKG_VERSION:=0.1.7
 PKG_RELEASE:=2

+ifeq ($(strip $(call 
CompareKernelPatchVer,$(KERNEL_PATCHVER),le,2.6.39)),1)

+
+PKG_VERSION:=0.1.7
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/usbip
 PKG_MD5SUM:=d1094b6d4449787864f8be001639232c

+else
+
+# Since kernel 2.6.39.1 userspace tools are inside the kernel tree
+# Package Automatic match version in kernel
+# MD5SUM is not useful kernel package already check it
+
+PKG_VERSION:=$(shell  sed -n -e 
'/^AC_INIT/s/.*\[\([[:digit:]\.]*\)\].*/\1/gp' 
$(LINUX_DIR)/drivers/staging/usbip/userspace/configure.ac)

+PKG_SOURCE:=
+PKG_SOURCE_URL:=
+PKG_MD5SUM:=unknown
+PATCH_DIR:=./patches-$(PKG_VERSION)
+
+define prepare_source_directory
+   rm -rf $(PKG_BUILD_DIR)
+   $(CP) $(LINUX_DIR)/drivers/staging/usbip/userspace $(PKG_BUILD_DIR)
+endef
+Hooks/Prepare/Pre += prepare_source_directory
+
+endif
+
 PKG_BUILD_DEPENDS:=glib2 sysfsutils
 PKG_FIXUP:=libtool autoreconf
 PKG_INSTALL:=1
@@ -51,7 +73,11 @@
 define Package/usbip-server
 $(call Package/usbip/Default)
   TITLE+= (server)
+ ifeq ($(strip $(call 
CompareKernelPatchVer,$(KERNEL_PATCHVER),le,2.6.39)),1)

   DEPENDS+= usbip +glib2 +kmod-usbip-server
+ else
+  DEPENDS+= usbip usbip-client +glib2 +kmod-usbip-server
+ endif
 endef

 define KernelPackage/usbip/Default
@@ -100,12 +126,30 @@

 include $(INCLUDE_DIR)/kernel-defaults.mk

+ifeq ($(strip $(call 
CompareKernelPatchVer,$(KERNEL_PATCHVER),le,2.6.39)),1)

 CONFIGURE_PATH:=./src
 MAKE_PATH:=./src
 LIBTOOL_PATHS:=./src
+else
+define Build/Configure
+   (cd $(PKG_BUILD_DIR); ./autogen.sh );
+   $(call Build/Configure/Default)
+endef
+CONFIGURE_PATH:=.
+MAKE_PATH:=.
+LIBTOOL_PATHS:=.
+MAKE_FLAGS+=CFLAGS=-Wno-implicit-function-declaration
+endif

 CFLAGS+=$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include

+define Download/usb.ids
+  URL:=http://www.linux-usb.org/
+  FILE:=usb.ids
+  MD5SUM:=01a93bd6c8cce28fa70a2c4504fb0041
+endef
+$(eval $(call Download,usb.ids))
+
 define Build/Compile/kmod
$(MAKE) $(KERNEL_MAKEOPTS) \
SUBDIRS=$(LINUX_DIR)/drivers/staging/usbip \
@@ -123,6 +167,7 @@
 $(call Build/Compile/kmod)
 endef

+ifeq ($(strip $(call 
CompareKernelPatchVer,$(KERNEL_PATCHVER),le,2.6.39)),1)

 define Package/usbip/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
@@ -132,7 +177,7 @@
$(CP) \
$(PKG_INSTALL_DIR)/usr/share/usbip/usb.ids \
$(1)/usr/share/usbip/
-endef
+endif

 define Package/usbip-client/install
$(INSTALL_DIR) $(1)/usr/bin
@@ -140,7 +185,6 @@
$(PKG_INSTALL_DIR)/usr/bin/usbip \
$(1)/usr/bin/
 endef
-
 define Package/usbip-server/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) \
@@ -150,7 +194,32 @@
$(PKG_INSTALL_DIR)/usr/bin/bind_driver \
$(1)/usr/bin/usbip_bind_driver
 endef
+else
+define Package/usbip/install
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) \
+   $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* \
+   $(1)/usr/lib/
+   $(INSTALL_DIR) $(1)/usr/share/hwdata
+   $(CP) \
+   $(DL_DIR)/usb.ids \
+   $(1)/usr/share/hwdata/
+endef

+define Package/usbip-client/install
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(CP) \
+   $(PKG_INSTALL_DIR)/usr/sbin/usbip \
+   $(1)/usr/sbin/
+endef
+define Package/usbip-server/install
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(CP) \
+   $(PKG_INSTALL_DIR)/usr/sbin/usbipd \
+   $(1)/usr/sbin/
+endef
+endif
+
 $(eval $(call BuildPackage,usbip))
 $(eval $(call BuildPackage,usbip-client))
 $(eval $(call BuildPackage,usbip-server))


--
Mehdi ABAAKOUK
sil...@sileht.net


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