Index: target/linux/ramips/image/Makefile
===================================================================
--- target/linux/ramips/image/Makefile	(revision 36855)
+++ target/linux/ramips/image/Makefile	(working copy)
@@ -332,6 +332,7 @@
 
 Image/Build/Profile/NBG-419N=$(call BuildFirmware/Default4M/$(1),$(1),nbg-419n,NBG-419N)
 
+mzkw300nh2_mtd_size=5111808
 Image/Build/Profile/MZKW300NH2=$(call BuildFirmware/Edimax/$(1),$(1),mzk-w300nh2,MZK-W300NH2,$(mzkw300nh2_mtd_size),CSYS,RN52,0x50000,0xc0000)
 
 nw718_mtd_size=3801088
Index: target/linux/ramips/base-files/etc/hotplug.d/button/01-button
===================================================================
--- target/linux/ramips/base-files/etc/hotplug.d/button/01-button	(revision 0)
+++ target/linux/ramips/base-files/etc/hotplug.d/button/01-button	(revision 0)
@@ -0,0 +1,28 @@
+. /lib/functions.sh
+do_button () {
+	local button
+	local action
+	local handler
+	local min
+	local max
+
+	config_get button $1 button
+	config_get action $1 action
+	config_get handler $1 handler
+	config_get min $1 min
+	config_get max $1 max
+	
+	[ "$ACTION" = "$action" -a "$BUTTON" = "$button" -a -n "$handler" ] && {
+		[ -z "$min" -o -z "$max" ] && eval $handler 
+		[ -n "$min" -a -n "$max" ] && {
+			[ $min -le $SEEN -a $max -ge $SEEN ] && eval $handler 
+		}
+	}
+}
+
+config_load system
+config_foreach do_button button
+
+[ "$ACTION" = "released" -a "$BUTTON" = "reset" ] && {
+	[ 10 -le $SEEN -a 20 -ge $SEEN ] && eval "/sbin/mtd -r erase rootfs_data" 
+}
Index: target/linux/ramips/base-files/etc/hotplug2.rules
===================================================================
--- target/linux/ramips/base-files/etc/hotplug2.rules	(revision 0)
+++ target/linux/ramips/base-files/etc/hotplug2.rules	(revision 0)
@@ -0,0 +1,10 @@
+$include /etc/hotplug2-common.rules
+
+SUBSYSTEM ~~ (^net$|^input$|button$|^usb$|^ieee1394$|^block$|^atm$|^zaptel$|^tty$) {
+	exec /sbin/hotplug-call %SUBSYSTEM%
+}
+
+DEVICENAME == watchdog {
+	exec /sbin/watchdog -t 5 /dev/watchdog
+	next-event
+}
Index: target/linux/ramips/patches-3.8/0208-owrt-mtd-split.patch
===================================================================
--- target/linux/ramips/patches-3.8/0208-owrt-mtd-split.patch	(revision 36855)
+++ target/linux/ramips/patches-3.8/0208-owrt-mtd-split.patch	(working copy)
@@ -33,7 +33,7 @@
 +static unsigned long find_uimage_size(struct mtd_info *mtd,
 +				      unsigned long offset)
 +{
-+#define UBOOT_MAGIC	0x56190527
++#define UBOOT_MAGIC	0x53595343
 +	unsigned long magic = 0;
 +	unsigned long temp;
 +	size_t len;
@@ -46,11 +46,11 @@
 +	if (le32_to_cpu(magic) != UBOOT_MAGIC)
 +		return 0;
 +
-+	ret = mtd_read(mtd, offset + 12, 4, &len, (void *)&temp);
++	ret = mtd_read(mtd, offset + 12+20, 4, &len, (void *)&temp);
 +	if (ret || len != sizeof(temp))
 +		return 0;
 +
-+	return be32_to_cpu(temp) + 0x40;
++	return be32_to_cpu(temp) + 0x40+0x14;
 +}
 +
 +static int detect_squashfs_partition(struct mtd_info *mtd, unsigned long offset)
Index: package/hotplug2/files/hotplug2.rules
===================================================================
--- package/hotplug2/files/hotplug2.rules	(revision 36855)
+++ package/hotplug2/files/hotplug2.rules	(working copy)
@@ -1,6 +1,6 @@
 $include /etc/hotplug2-common.rules
 
-SUBSYSTEM ~~ (^net$|^input$|^button$|^usb$|^ieee1394$|^block$|^atm$|^zaptel$|^tty$) {
+SUBSYSTEM ~~ (^net$|^input$|button$|^usb$|^ieee1394$|^block$|^atm$|^zaptel$|^tty$) {
 	exec /sbin/hotplug-call %SUBSYSTEM%
 }
 
Index: package/base-files/files.old/lib/preinit/10_essential_fs
===================================================================
--- package/base-files/files.old/lib/preinit/10_essential_fs	(revision 36855)
+++ package/base-files/files.old/lib/preinit/10_essential_fs	(working copy)
@@ -12,6 +12,7 @@
 
 calc_tmpfs_size() {
     pi_size=$(awk '/MemTotal:/ {l=5242880;mt=($2*1024);print((s=mt/2)<l)&&(mt>l)?mt-l:s}' /proc/meminfo)
+pi_size="2048k"
 }
 
 do_mount_tmpfs() {
