This adds userspace support for the ALL6000.
I'll add sysupgrade, and firstboot/preinit in the next days, so things will
work smoothly with UBIFS as (rom) rootfs.

Signed-off-by: Daniel Golle <dgo...@allnet.de>

diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/network 
b/target/linux/kirkwood/base-files/etc/uci-defaults/network
index 48c1232..70918ef 100644
--- a/target/linux/kirkwood/base-files/etc/uci-defaults/network
+++ b/target/linux/kirkwood/base-files/etc/uci-defaults/network
@@ -32,6 +32,10 @@ case "$hardware" in
        set_lan_dhcp "eth0"
        ;;
 
+"Allnet ALL6000")
+       ucidef_set_interface_lan "eth0 eth1"
+       ;;
+
 *)
        ucidef_set_interface_lan "eth0"
        ;;
diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/ubootenv 
b/target/linux/kirkwood/base-files/etc/uci-defaults/ubootenv
new file mode 100644
index 0000000..a3447e1
--- /dev/null
+++ b/target/linux/kirkwood/base-files/etc/uci-defaults/ubootenv
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+
+add_ubootenv() {
+       local dev=$1
+       local offset=$2
+       local envsize=$3
+       local secsize=$4
+       local numsec=$5
+       uci batch <<EOF
+add ubootenv ubootenv
+set ubootenv.@ubootenv[-1].dev='$dev'
+set ubootenv.@ubootenv[-1].offset='$offset'
+set ubootenv.@ubootenv[-1].envsize='$envsize'
+set ubootenv.@ubootenv[-1].secsize='$secsize'
+set ubootenv.@ubootenv[-1].numsec='$numsec'
+EOF
+}
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/kirkwood.sh
+
+hardware=$(kirkwood_hardware_name)
+
+case "$hardware" in
+Allnet ALL6000)
+       add_ubootenv /dev/mtd1 0x0 0x20000 0x20000
+       ;;
+
+esac
+
+uci commit ubootenv

Attachment: pgpFggRbEM1U1.pgp
Description: PGP signature

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

Reply via email to