DGND3700 V1 Transmission Bittorrent Firmware (original)

From richud.com
Jump to navigation Jump to search


This page documents the first version of the firmware for information only


Download

If you want to skip the blurb and just download it is here;

https://mega.co.nz/#!AVpnFZjb!AhN33SXTgd-aIEhoAH7SxjG6dVUApRQd8RxOam9sMYI

MD5 ea451ae6e34c48e66292cd1237791413 DGND3700_03021748_A_D.chk

Creating the toolchain

You first need to create a fully compatible toolchain, please see here

Structure

This is my dir structure. It is a combination of the extracted GPL firmware nicely provided by Netgear and in addition I have a patches folder, a sources folder and add.sh which unpacks and patches everything from these two folders.

$ cd DGND3700_V1.0.0.17_1.0.17_src_full
$ tree -L 2
.
├── add.sh
├── DGND3700
│   ├── bcmdrivers
│   ├── data-model
│   ├── hostTools
│   ├── images
│   ├── kernel
│   ├── make.common
│   ├── make.deprules
│   ├── Makefile
│   ├── make.voice
│   ├── README
│   ├── shared
│   ├── targets
│   ├── userspace
│   └── version.make
├── DGND3700_build_instructions.txt
├── DGND3700_src.tar
├── patches
│   ├── curl_Makefile.in.patch
│   ├── curl_Makefile.patch
│   ├── dropbear_common-session.c.patch
│   ├── dropbear.Makefile.in.patch
│   ├── dropbear.Makefile.patch
│   ├── dropbear_sshpty.c.patch
│   ├── dropbear_svr-auth.c.patch
│   ├── fs.install_www_MNU_menu.htm.patch
│   ├── fs.src_etc_inittab.patch
│   ├── fs.src_etc_profile_dgnd3700.patch
│   ├── hosttools_fakeroot_fakeroot.patch
│   ├── kernel.config.patch
│   ├── libevent_Makefile.in.patch
│   ├── libevent_Makefile.patch
│   ├── libreduction_extralibs.patch
│   ├── make.common.patch
│   ├── Makefile.patch
│   ├── ntfs-3g_Makefile.in.patch
│   ├── ntfs-3g_Makefile.patch
│   ├── openssl_Makefile.patch
│   ├── samba_Makefile.patch
│   ├── strace_Makefile.in.patch
│   ├── strace_Makefile.patch
│   ├── targets_buildFS.patch
│   ├── targets_makeDevs.patch
│   ├── transmission_Makefile.in.patch
│   ├── transmission_Makefile.patch
│   ├── userspace_ap_gpl_config.in.patch
│   ├── userspace_gpl_apps_Makefile.patch
│   └── userspace_project_gpl_Makefile.patch
└── sources
    ├── adsl_phy.bin
    ├── busybox-1.21.0.tar.bz2
    ├── curl-7.29.0.tar.bz2
    ├── dropbear-2012.55.tar.bz2
    ├── dropbear_rsa_host_key
    ├── libevent-2.0.21-stable.tar.gz
    ├── nat5.tar.gz
    ├── ntfs-3g_ntfsprogs-2013.1.13.tgz
    ├── settings_dgn2200.JPG
    ├── strace-4.7.tar.xz
    └── transmission-2.77.tar.xz

Add.sh

#!/bin/bash

#Base paths
ROOT="$(pwd)"
sources="$ROOT/sources"
patches="$ROOT/patches"

#####
#GPL
#####

target="$ROOT/DGND3700/userspace/ap/gpl"
target2="$ROOT/DGND3700/userspace/gpl/apps"
target3="$ROOT/DGND3700/bcmdrivers/broadcom/char/adsl/impl1"
target4="$ROOT/DGND3700/targets/DGND3700/fs.install/www"
target5="$ROOT/DGND3700/targets/fs.src/etc"

tar -jxf "$sources/curl-7.29.0.tar.bz2" -C "$target"
tar -zxf "$sources/libevent-2.0.21-stable.tar.gz" -C "$target"
tar -Jxf "$sources/transmission-2.77.tar.xz" -C "$target"
tar -Jxf "$sources/strace-4.7.tar.xz" -C "$target"
tar -zxf "$sources/ntfs-3g_ntfsprogs-2013.1.13.tgz" -C "$target"
tar -zxf "$sources/nat5.tar.gz" -C "$target"
tar -jxf "$sources/dropbear-2012.55.tar.bz2" -C "$target"
tar -jxf "$sources/busybox-1.21.0.tar.bz2" -C "$target2"

#copy stuff not patchable or not worth bothering to patch
cp "$sources/.config" "$target2/busybox-1.21.0" #busybox config
cp "$sources/adsl_phy.bin" "$target3/adsl_phyDGND3700.bin_save" #ADSL binary blob
cp "$sources/settings_dgn2200.JPG" "$target4" #graphics
cp "$sources/dropbear_rsa_host_key"  "$target5" #dropbear key

########
#PATCHES
########

for i in $(ls $patches/*\.patch)
do
	echo Patching "$i"
	patch -N -p0 < "$i"
done

####################
### dont forget to!
####################
echo "Dont forget to:"
echo "sudo -i"
echo  "cd $ROOT/DGND3700"
echo 'export PATH=${PATH}:/opt/toolchains/uclibc-crosstools-gcc-4.2.3-3/usr/bin'
echo "make PROFILE=DGND3700"

Patches

curl_Makefile.in.patch

--- DGND3700/userspace/ap/gpl/curl-7.29.0/Makefile.in.orig	2013-02-06 10:14:03.000000000 +0000
+++ DGND3700/userspace/ap/gpl/curl-7.29.0/Makefile.in	2013-02-13 18:54:37.064856529 +0000
@@ -839,7 +839,10 @@
 	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
-install: install-recursive
+install:
+	echo "Copying libcUrl library"
+	$(STRIP) lib/.libs/libcurl.so*
+	cp -a lib/.libs/libcurl.so* $(TARGETDIR)/lib/
 install-exec: install-exec-recursive
 install-data: install-data-recursive
 uninstall: uninstall-recursive

curl_Makefile.patch

--- DGND3700/userspace/ap/gpl/curl-7.29.0/Makefile.orig	2013-02-06 10:14:10.000000000 +0000
+++ DGND3700/userspace/ap/gpl/curl-7.29.0/Makefile	2013-02-13 14:33:26.879034573 +0000
@@ -23,7 +23,7 @@
 VC=vc6
 
 all:
-	./configure
+	CFLAGS="-O2 -march=mips32  -fomit-frame-pointer -fno-strict-aliasing -mabi=32 -G 0 -msoft-float -pipe -Wa,-mips32" ./configure --host=mips-linux --disable-pop3 --disable-gopher --disable-imap --disable-rtsp --disable-smtp --disable-tftp --disable-telnet --disable-rtsp --disable-file --disable-dict --disable-ftp --with-zlib="$(BUILD_DIR)/userspace/ap/gpl/minidlna/zlib-1.2.3" --with-ssl=$(BUILD_DIR)/userspace/public/libs/openssl LDFLAGS="-L$(BUILD_DIR)/userspace/public/libs/openssl -L$(BUILD_DIR)/userspace/ap/gpl/minidlna/zlib-1.2.3" LIBS="-lcrypto -lssl" CPPFLAGS="-I$(BUILD_DIR)/userspace/public/libs/openssl/include -I$(BUILD_DIR)/userspace/ap/gpl/minidlna/zlib-1.2.3"
 	make
 
 ssl:

dropbear_common-session.c.patch

--- DGND3700/userspace/ap/gpl/dropbear-2012.55/common-session.c.orig	2013-03-01 22:52:49.768785918 +0000
+++ DGND3700/userspace/ap/gpl/dropbear-2012.55/common-session.c	2013-03-01 22:58:42.456134373 +0000
@@ -430,7 +430,7 @@
 	if (ses.authstate.pw_shell[0] == '\0') {
 		return "/bin/sh";
 	} else {
-		return ses.authstate.pw_shell;
+		return "/bin/sh";
 	}
 }
 void fill_passwd(const char* username) {

dropbear.Makefile.in.patch

--- DGND3700/userspace/ap/gpl/dropbear-2012.55/Makefile.in.orig	2013-02-27 13:25:34.286790683 +0000
+++ DGND3700/userspace/ap/gpl/dropbear-2012.55/Makefile.in	2013-02-27 13:31:17.978798255 +0000
@@ -118,7 +118,10 @@
 strip: $(TARGETS)
 	$(STRIP) $(addsuffix $(EXEEXT), $(TARGETS))
 
-install: $(addprefix inst_, $(TARGETS))
+install:
+	echo "Copying dropbear binary"
+	$(STRIP) dropbear
+	cp -a dropbear $(TARGETDIR)/sbin
 
 installdropbearmulti: insdbmulti $(addprefix insmulti, $(PROGRAMS))

dropbear.Makefile.patch

--- DGND3700/userspace/ap/gpl/dropbear-2012.55/Makefile.orig	1970-01-01 01:00:00.000000000 +0100
+++ DGND3700/userspace/ap/gpl/dropbear-2012.55/Makefile	2013-02-27 13:28:49.890794992 +0000
@@ -0,0 +1,3 @@
+all:
+	./configure --host=mips-linux --disable-syslog --disable-lastlog --disable-utmp --disable-utmpx --disable-wtmp --disable-wtmpx --disable-openpty --with-zlib="$(BUILD_DIR)/userspace/ap/gpl/minidlna/zlib-1.2.3" LDFLAGS="-L$(BUILD_DIR)/userspace/ap/gpl/minidlna/zlib-1.2.3" CPPFLAGS="-I$(BUILD_DIR)/userspace/ap/gpl/minidlna/zlib-1.2.3"
+	make

dropbear_sshpty.c.patch

--- DGND3700/userspace/ap/gpl/dropbear-2012.55/sshpty.c.orig	2013-03-01 21:40:16.665631071 +0000
+++ DGND3700/userspace/ap/gpl/dropbear-2012.55/sshpty.c	2013-03-01 21:46:44.113082534 +0000
@@ -389,7 +389,7 @@
 						tty_name, (unsigned int)pw->pw_uid, (unsigned int)gid,
 						strerror(errno));
 			} else {
-				dropbear_exit("chown(%.100s, %u, %u) failed: %.100s",
+				dropbear_log("chown(%.100s, %u, %u) failed: %.100s",
 				    tty_name, (unsigned int)pw->pw_uid, (unsigned int)gid,
 				    strerror(errno));
 			}
@@ -404,7 +404,7 @@
 					"chmod(%.100s, 0%o) failed: %.100s",
 					tty_name, mode, strerror(errno));
 			} else {
-				dropbear_exit("chmod(%.100s, 0%o) failed: %.100s",
+				dropbear_log("chmod(%.100s, 0%o) failed: %.100s",
 				    tty_name, mode, strerror(errno));
 			}
 		}

dropbear_svr-auth.c.patch

--- DGND3700/userspace/ap/gpl/dropbear-2012.55/svr-auth.c.orig	2013-03-01 22:00:10.516280692 +0000
+++ DGND3700/userspace/ap/gpl/dropbear-2012.55/svr-auth.c	2013-03-01 22:13:11.803293071 +0000
@@ -258,6 +258,8 @@
 		usershell = "/bin/sh";
 	}
 
+	/* force it as /etc/passwd gets made by httpd with DOS carriage returns appended to the shell */
+	usershell =  "/bin/sh";
 	/* check the shell is valid. If /etc/shells doesn't exist, getusershell()
 	 * should return some standard shells like "/bin/sh" and "/bin/csh" (this
 	 * is platform-specific) */

fs.install_www_MNU_menu.htm.patch

--- DGND3700/targets/DGND3700/fs.install/www/MNU_menu.htm.orig	2013-02-27 20:22:40.991815187 +0000
+++ DGND3700/targets/DGND3700/fs.install/www/MNU_menu.htm	2013-02-27 20:26:32.737737447 +0000
@@ -260,6 +260,16 @@
     <TD vAlign=top><IMG height=7 alt="" src="redbull.gif" width=7 align=top vspace=6></TD>
     <TD><A href="USB_settings.htm" target=formframe><%599%></A></TD>
 </TR>
+
+  <TR>
+    <TD colSpan=2><BIG>BitTorrent</BIG></TD></TR>
+  <TR>
+
+  <TR>
+    <TD vAlign=top><IMG height=7 alt="" src="redbull.gif" width=7 align=top vspace=6></TD>
+    <TD><A HREF="javascript:parent.location.href=location.protocol+'//'+location.hostname+':55555'">Transmission</A></TD>
+  </TR>
+
   <TR>
     <TD colSpan=2><BIG><%600%></BIG></TD></TR>
   <TR>

fs.src_etc_inittab.patch

--- DGND3700/targets/fs.src/etc/inittab.orig	2013-02-25 21:50:41.522049130 +0000
+++ DGND3700/targets/fs.src/etc/inittab	2013-02-25 21:51:31.050508442 +0000
@@ -1,5 +1,5 @@
 ::sysinit:/etc/init.d/rcS
 ::respawn:-/bin/sh
-tty2::askfirst:-/bin/sh
-::ctrlaltdel:/bin/umount -a -r
+#tty2::askfirst:-/bin/sh
+#::ctrlaltdel:/bin/umount -a -r

fs.src_etc_profile_dgnd3700.patch

--- DGND3700/targets/fs.src/etc/profile_dgnd3700.orig	2013-02-27 20:37:22.216118384 +0000
+++ DGND3700/targets/fs.src/etc/profile_dgnd3700	2013-02-27 21:01:53.236052774 +0000
@@ -28,53 +28,80 @@
 
  echo > /var/udhcpd/udhcpd.leases
  ifconfig lo 127.0.0.1 netmask 255.0.0.0 broadcast 127.255.255.255 up
-# /etc/modules_install /lib/modules/$KERNELVER/extra
- test -e /lib/modules/$KERNELVER/extra/bcm_log.ko && insmod /lib/modules/$KERNELVER/extra/bcm_log.ko
- test -e /lib/modules/$KERNELVER/extra/pktflow.ko && insmod /lib/modules/$KERNELVER/extra/pktflow.ko
- test -e /lib/modules/$KERNELVER/extra/pktcmf.ko && insmod /lib/modules/$KERNELVER/extra/pktcmf.ko
- test -e /lib/modules/$KERNELVER/extra/bcmfap.ko && insmod /lib/modules/$KERNELVER/extra/bcmfap.ko
- test -e /etc/cmf/cmfcfg && /etc/cmf/cmfcfg
- test -e /lib/modules/$KERNELVER/extra/profdrvdd.ko && insmod /lib/modules/$KERNELVER/extra/profdrvdd.ko
- test -e /lib/modules/$KERNELVER/extra/bcmxtmcfg.ko && insmod /lib/modules/$KERNELVER/extra/bcmxtmcfg.ko
- test -e /lib/modules/$KERNELVER/extra/atmapi.ko && insmod /lib/modules/$KERNELVER/extra/atmapi.ko
- test -e /lib/modules/$KERNELVER/extra/adsldd.ko && insmod /lib/modules/$KERNELVER/extra/adsldd.ko
- test -e /lib/modules/$KERNELVER/extra/blaa_dd.ko && insmod /lib/modules/$KERNELVER/extra/blaa_dd.ko
- test -e /lib/modules/$KERNELVER/extra/bcmprocfs.ko && insmod /lib/modules/$KERNELVER/extra/bcmprocfs.ko
-# test -e /lib/modules/$KERNELVER/kernel/net/ipv6/ipv6.ko && insmod /lib/modules/$KERNELVER/kernel/net/ipv6/ipv6.ko
- test -e /lib/modules/$KERNELVER/kernel/net/atm/br2684.ko && insmod /lib/modules/$KERNELVER/kernel/net/atm/br2684.ko
- test -e /lib/modules/$KERNELVER/extra/linux-kernel-bde.ko && insmod /lib/modules/$KERNELVER/extra/linux-kernel-bde.ko
- test -e /lib/modules/$KERNELVER/extra/linux-user-bde.ko && insmod /lib/modules/$KERNELVER/extra/linux-user-bde.ko
- test -e /lib/modules/$KERNELVER/extra/bcm_enet.ko && insmod /lib/modules/$KERNELVER/extra/bcm_enet.ko
- test -e /lib/modules/$KERNELVER/extra/bcmsw.ko && insmod /lib/modules/$KERNELVER/extra/bcmsw.ko && ifconfig bcmsw up
- test -e /lib/modules/$KERNELVER/extra/bcm_usb.ko && insmod /lib/modules/$KERNELVER/extra/bcm_usb.ko
 
-#WLAN Module
- test -e /lib/modules/$KERNELVER/extra/wl.ko && insmod /lib/modules/$KERNELVER/extra/wl.ko
- test -e /lib/modules/$KERNELVER/extra/multissidcontrol.ko && insmod /lib/modules/$KERNELVER/extra/multissidcontrol.ko
- test -e /etc/wlan/rtecdc.trx && mount -t usbfs none /proc/bus/usb && /bin/bcmdl /etc/wlan/rtecdc.trx && sleep 2 && insmod /lib/modules/$KERNELVER/extra/wl-usb.ko
- 
- test -e /lib/modules/$KERNELVER/extra/dspdd.ko && insmod /lib/modules/$KERNELVER/extra/dspdd.ko
- test -e /lib/modules/$KERNELVER/extra/endpointdd.ko && insmod /lib/modules/$KERNELVER/extra/endpointdd.ko
- test -e /lib/modules/$KERNELVER/extra/p8021ag.ko && insmod /lib/modules/$KERNELVER/extra/p8021ag.ko
-
-# other modules
- test -e /lib/modules/$KERNELVER/extra/isdn.ko && insmod /lib/modules/$KERNELVER/extra/isdn.ko
- test -e /lib/modules/$KERNELVER/kernel/drivers/isdn/capi/capi.ko && insmod /lib/modules/$KERNELVER/kernel/drivers/isdn/capi/capi.ko 
- test -e /lib/modules/$KERNELVER/extra/i2c_bcm6xxx.ko && insmod /lib/modules/$KERNELVER/extra/i2c_bcm6xxx.ko
- test -e /lib/modules/$KERNELVER/extra/bcm3450.ko && insmod /lib/modules/$KERNELVER/extra/bcm3450.ko
- test -e /lib/modules/$KERNELVER/extra/gpon_i2c.ko && insmod /lib/modules/$KERNELVER/extra/gpon_i2c.ko
- test -e /lib/modules/$KERNELVER/extra/bcmgpon.ko && insmod /lib/modules/$KERNELVER/extra/bcmgpon.ko
- test -e /lib/modules/$KERNELVER/extra/bcmmoca.ko && insmod /lib/modules/$KERNELVER/extra/bcmmoca.ko
- test -e /lib/modules/$KERNELVER/extra/bcmvlan.ko && insmod /lib/modules/$KERNELVER/extra/bcmvlan.ko
- test -e /lib/modules/$KERNELVER/extra/pwrmngtd.ko && insmod /lib/modules/$KERNELVER/extra/pwrmngtd.ko
- test -e /lib/modules/$KERNELVER/kernel/drivers/char/hw_random/rng-core.ko && insmod /lib/modules/$KERNELVER/kernel/drivers/char/hw_random/rng-core.ko
- test -e /lib/modules/$KERNELVER/extra/bcmtrng.ko && insmod /lib/modules/$KERNELVER/extra/bcmtrng.ko
- insmod /lib/modules/$KERNELVER/extra/acos_nat.ko
+ echo ## Installing modules from /lib/modules/$KERNELVER/extra
+ for i in wl.ko pktflow.ko pktcmf.ko bcmxtmcfg.ko adsldd.ko bcmprocfs.ko multissidcontrol.ko p8021ag.ko bcm_enet.ko acos_nat.ko
+ do
+  echo ## Installing module $i
+  insmod /lib/modules/$KERNELVER/extra/$i
+ done
 
 cmf learn --disable
 param init
 acos_init
 acos_service start
 
+ #adslctl configure --snr 150
+ killall telnetenabled
+ echo ## Starting Dropbear SSH daemon
+ echo admin:$(mkpasswd $(param show http_passwd | sed "s#http_passwd=##")):0:0::::: > /etc/shadow
+ nice -17 dropbear -r /etc/dropbear_rsa_host_key
+ sleep 40
+ echo ## Sharing out any available partitions including ext2 and ext3
+ for i in $(grep -o sd[a-z][0-9] /proc/partitions)
+ do
+  mkdir -p /tmp/mount/$i
+  mount -o noatime /dev/$i /tmp/mount/$i 
+  if [ $? = 0 ]
+  then
+    echo "[DGND3700 $i $(blkid /dev/$i | cut -d"\"" -f2)]
+    comment=Drive $i Share on DGND3700
+    path = /tmp/mount/$i
+    browseable = yes
+    writeable = yes
+    guest ok = yes
+    " >> /tmp/samba/private/smb.conf
+  fi
+ done
+ killall smbd
+ killall nmbd
+ echo 1 > /tmp/all_no_password
+ nice -n 18 /usr/local/samba/smbd -D
+ nice -n 18 /usr/local/samba/nmbd -D
+ tmiss=$(find /tmp/mount -maxdepth 2 -follow -type d -iname "transmissionbt")
+ if [ -d "$tmiss" ]
+ then
+  export HOME="$tmiss"
+  export TRANSMISSION_HOME="$tmiss"
+  echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout
+  echo 300 > /proc/sys/net/ipv4/tcp_keepalive_time
+  echo 4194304 > /proc/sys/net/core/rmem_max
+  echo 4194304 > /proc/sys/net/core/wmem_max
+  /bin/nat5 agApi_setDeviceListenPortRange 2 55555 55800 0
+  /bin/nat5 agApi_fwListenPortList 0 0 0 0
+  if [ ! -e "$tmiss/settings.json" ]
+  then
+   echo '{
+   "rpc-whitelist": "127.0.0.1,192.168.*.*", 
+   "rpc-port": 55555, 
+   "peer-port": 55556, 
+   "peer-port-random-high": 55800, 
+   "peer-port-random-low": 55556, 
+   "peer-limit-global": 40, 
+   "peer-limit-per-torrent": 40, 
+   "upload-slots-per-torrent": 4, 
+   "speed-limit-up": 50, 
+   "speed-limit-up-enabled": true,
+   "speed-limit-down": 600, 
+   "speed-limit-down-enabled": true, 
+   "message-level": 0, 
+   "port-forwarding-enabled": false, 
+   "peer-port-random-on-start": true 
+   }' > "$tmiss/settings.json"
+   else
+    sed -i "s#/tmp/mount/.*/transmissionbt/#$tmiss/#g" "$tmiss/settings.json"
+   fi
+  nice -n 19 /bin/transmission-daemon
+ fi
 fi

hosttools_fakeroot_fakeroot.patch

--- DGND3700/hostTools/fakeroot/fakeroot.orig	2011-10-31 01:50:45.000000000 +0000
+++ DGND3700/hostTools/fakeroot/fakeroot	2013-02-10 16:32:01.470822714 +0000
@@ -15,12 +15,12 @@
 }
 
 # strip /bin/fakeroot to find install prefix
-PREFIX=/home/finerain/DGND3700-V1.0.0.17_1.0.17_GPL/bcm963xx/hostTools/fakeroot
-BINDIR=/home/finerain/DGND3700-V1.0.0.17_1.0.17_GPL/bcm963xx/hostTools/fakeroot
+PREFIX=../hostTools/fakeroot
+BINDIR=../hostTools/fakeroot
     
 USEABSLIBPATH=0
 LIB=libfakeroot.so
-PATHS=/home/finerain/DGND3700-V1.0.0.17_1.0.17_GPL/bcm963xx/hostTools/fakeroot/.libs:/lib:/usr/lib
+PATHS=../hostTools/fakeroot/.libs:/lib:/usr/lib
 FAKED=${BINDIR}/faked
 
 FAKED_MODE="unknown-is-root"

kernel.config.patch

--- DGND3700/kernel/linux/defconfig_dgnd3700.orig	2011-10-20 10:37:10.000000000 +0100
+++ DGND3700/kernel/linux/defconfig_dgnd3700	2013-02-26 20:50:28.850290073 +0000
@@ -246,7 +246,7 @@
 # CONFIG_SYSFS_DEPRECATED is not set
 # CONFIG_RELAY is not set
 # CONFIG_BLK_DEV_INITRD is not set
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
 CONFIG_SYSCTL_SYSCALL=y
@@ -1250,9 +1250,17 @@
 #
 # File systems
 #
-# CONFIG_EXT2_FS is not set
-# CONFIG_EXT3_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
 # CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 # CONFIG_FS_POSIX_ACL is not set

libevent_Makefile.in.patch

--- DGND3700/userspace/ap/gpl/libevent-2.0.21-stable/Makefile.in.orig	2012-11-19 15:13:17.000000000 +0000
+++ DGND3700/userspace/ap/gpl/libevent-2.0.21-stable/Makefile.in	2013-02-13 18:42:12.945861772 +0000
@@ -1178,8 +1178,11 @@
 	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
-install: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) install-recursive
+install:
+	echo "Copying libevent library"
+	$(STRIP) .libs/libevent.so*
+	cp -a .libs/libevent.so* $(TARGETDIR)/lib/
+	cp -a .libs/libevent-2.0.so* $(TARGETDIR)/lib/
 install-exec: install-exec-recursive
 install-data: install-data-recursive
 uninstall: uninstall-recursive

libevent_Makefile.patch

--- DGND3700/userspace/ap/gpl/libevent-2.0.21-stable/Makefile.orig	1970-01-01 01:00:00.000000000 +0100
+++ DGND3700/userspace/ap/gpl/libevent-2.0.21-stable/Makefile	2013-02-13 16:10:23.154956649 +0000
@@ -0,0 +1,3 @@
+all:
+	./configure --host=mips-linux --disable-debug-mode --disable-openssl
+	make

libreduction_extralibs.patch

--- DGND3700/hostTools/libcreduction/extralibs.mak.orig	2011-10-20 11:08:52.000000000 +0100
+++ DGND3700/hostTools/libcreduction/extralibs.mak	2013-02-16 11:25:38.270543318 +0000
@@ -7,6 +7,7 @@
 TARGETS += $(LIBDIR)/libcrypt.so.0
 TARGETS += $(LIBDIR)/libutil.so.0
 TARGETS += $(LIBDIR)/libnsl.so.0
+TARGETS += $(LIBDIR)/librt.so.0
 
 ifneq ($(strip $(BRCM_PTHREADS)),)
   TARGETS += $(LIBDIR)/libpthread.so.0

make.common.patch

--- DGND3700/make.common.orig	2013-02-26 20:05:07.817351925 +0000
+++ DGND3700/make.common	2013-02-26 20:05:12.981562482 +0000
@@ -141,7 +141,7 @@
 EXTRALIBDIR = $(TOOLCHAIN_TOP)/usr/mips-linux-uclibc/lib
 LIB_PATH        = $(TOOLCHAIN_TOP)/lib
 LIBCDIR         = $(TOOLCHAIN_TOP)/lib
-BRCM_COMMON_CFLAGS :=  -Os -march=mips32  -fomit-frame-pointer -fno-strict-aliasing -mabi=32 -G 0 -msoft-float -pipe -Wa,-mips32
+BRCM_COMMON_CFLAGS :=  -O2 -march=mips32  -fomit-frame-pointer -fno-strict-aliasing -mabi=32 -G 0 -msoft-float -pipe -Wa,-mips32
 export BRCM_APP_CFLAGS :=  $(BRCM_COMMON_CFLAGS) -mno-shared
 export BRCM_SO_CFLAGS :=   $(BRCM_COMMON_CFLAGS)

Makefile.patch

--- DGND3700/Makefile.orig	2011-10-31 01:47:56.000000000 +0000
+++ DGND3700/Makefile	2013-02-13 20:27:12.912611073 +0000
@@ -40,7 +40,7 @@
 #
 ############################################
 
-all: check_dsl_type make_version_check kernel_version_check all_postcheck1
+all: check_dsl_type make_version_check all_postcheck1
 
 ## 
 ##all_postcheck1: sanity_check \
@@ -210,6 +210,7 @@
 	$(MAKE) -C $(USERAPPS_DIR)/ap/acos install
 
 gpl:
+	$(MAKE) -C $(USERAPPS_DIR)/public/libs/openssl all install
 	$(MAKE) -C $(USERAPPS_DIR)/ap/gpl
 	$(MAKE) -C $(USERAPPS_DIR)/ap/gpl install

ntfs-3g_Makefile.in.patch

--- DGND3700/userspace/ap/gpl/ntfs-3g_ntfsprogs-2013.1.13/Makefile.in.orig	2013-01-13 06:46:46.000000000 +0000
+++ DGND3700/userspace/ap/gpl/ntfs-3g_ntfsprogs-2013.1.13/Makefile.in	2013-02-19 18:13:15.355964804 +0000
@@ -614,7 +614,12 @@
 	for dir in "$(DESTDIR)$(docdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
-install: install-recursive
+install: 
+	echo "Copying NTFS-3G binary and libs"
+	$(STRIP) src/.libs/ntfs-3g
+	cp -a src/.libs/ntfs-3g $(TARGETDIR)/bin/
+	$(STRIP) libntfs-3g/.libs/libntfs-3g.so*
+	cp -a libntfs-3g/.libs/libntfs-3g.so* $(TARGETDIR)/lib
 install-exec: install-exec-recursive
 install-data: install-data-recursive
 uninstall: uninstall-recursive

ntfs-3g_Makefile.patch

--- DGND3700/userspace/ap/gpl/ntfs-3g_ntfsprogs-2013.1.13/Makefile.orig	1970-01-01 01:00:00.000000000 +0100
+++ DGND3700/userspace/ap/gpl/ntfs-3g_ntfsprogs-2013.1.13/Makefile	2013-02-19 18:05:47.407620022 +0000
@@ -0,0 +1,3 @@
+all:
+	./configure --host=mips-linux
+	make

openssl_Makefile.patch

--- DGND3700/userspace/public/libs/openssl/Makefile.orig	2011-10-31 01:49:34.000000000 +0000
+++ DGND3700/userspace/public/libs/openssl/Makefile	2013-02-15 15:28:01.049869893 +0000
@@ -26,9 +26,9 @@
 SHLIB_EXT=.so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 PLATFORM=linux-mips
 ifeq ($(strip $(BUILD_HTTPD_SSL)),)
-OPTIONS=no-krb5 no-hw shared no-threads no-zlib no-bf no-cast no_md2 no-md4 no-mdc2 no-ripemd no-rc2 no-krb5 no_dsa no_ec no_speed no_engine no_ocsp
+OPTIONS=no-krb5 no-hw shared no-threads no-zlib no-bf no-cast no_md2 no-mdc2 no-ripemd no-rc2 no-krb5 no_dsa no_ec no_speed no_engine no_ocsp
 else
-OPTIONS=no-krb5 no-hw shared no-threads no-zlib no-bf no-cast no_md2 no-md4 no-mdc2 no-ripemd no-rc2 no-krb5 no_dsa no_ec no_speed
+OPTIONS=no-krb5 no-hw shared no-threads no-zlib no-bf no-cast no_md2 no-mdc2 no-ripemd no-rc2 no-krb5 no_dsa no_ec no_speed
 endif
 CONFIGURE_ARGS=no-krb5 no-hw shared linux-mips
 SHLIB_TARGET=linux-shared
@@ -79,12 +79,12 @@
 #CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
 #CFLAG= -DOPENSSL_NO_KRB5 -O
 CFLAG= -fPIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_NO_KRB5 -DOPENSSL_NO_HW -DB_ENDIAN -Os -fomit-frame-pointer -Wall
-CFLAG+= -DOPENSSL_NO_IDEA  -DOPENSSL_NO_BF -DOPENSSL_NO_CAST -DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4 -DOPENSSL_NO_RIPEMD -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC2 -DOPENSSL_NO_DSA -DOPENSSL_NO_EC -DOPENSSL_NO_SPEED
+CFLAG+= -DOPENSSL_NO_IDEA  -DOPENSSL_NO_BF -DOPENSSL_NO_CAST -DOPENSSL_NO_MD2 -DOPENSSL_NO_RIPEMD -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC2 -DOPENSSL_NO_DSA -DOPENSSL_NO_EC -DOPENSSL_NO_SPEED
 ifeq ($(strip $(BUILD_HTTPD_SSL)),)
 CFLAG+= -DOPENSSL_NO_ENGINE -DOPENSSL_NO_OCSP
 CFLAG+= -DOPENSSL_NO_RC5 -DOPENSSL_NO_ERR -DOPENSSL_NO_SSL2 
 ifeq ($(strip $(BUILD_TR69C_SSL)),)
-CFLAG+= -DOPENSSL_NO_RC4
+#CFLAG+= -DOPENSSL_NO_RC4
 endif
 endif
 
@@ -225,8 +225,8 @@
 
 # dirs in crypto to build
 SDIRS=  objects \
-	md5 sha hmac \
-	des dh\
+	md4 md5 sha hmac \
+	des rc4 dh\
 	bn rsa dso \
 	buffer stack rand err \
 	evp asn1 pem x509 lhash bio txt_db x509v3 conf pkcs7 pkcs12 comp ui

samba_Makefile.patch

--- DGND3700/userspace/ap/gpl/samba-3.0.13/Makefile.orig	2011-10-20 10:49:40.000000000 +0100
+++ DGND3700/userspace/ap/gpl/samba-3.0.13/Makefile	2013-02-27 20:19:17.155262251 +0000
@@ -1,7 +1,7 @@
 all: .conf makesmb
 .conf:
 	cd source ; \
-	./configure --without-python \
+	CFLAGS="-O2 -march=mips32  -fomit-frame-pointer -fno-strict-aliasing -mabi=32 -G 0 -msoft-float -pipe -Wa,-mips32" ./configure --without-python \
 	            --with-included-popt \
 	            --without-acl-support \
 	            --without-spinlocks \

strace_Makefile.in.patch

--- DGND3700/userspace/ap/gpl/strace-4.7/Makefile.in.orig	2012-05-02 16:40:25.000000000 +0100
+++ DGND3700/userspace/ap/gpl/strace-4.7/Makefile.in	2013-02-16 18:00:13.728315414 +0000
@@ -968,8 +968,10 @@
 	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
-install: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) install-recursive
+install:
+	echo "Copying strace"
+	$(STRIP) strace
+	cp -a strace $(TARGETDIR)/bin/
 install-exec: install-exec-recursive
 install-data: install-data-recursive
 uninstall: uninstall-recursive

strace_Makefile.patch

--- DGND3700/userspace/ap/gpl/strace-4.7/Makefile.orig	1970-01-01 01:00:00.000000000 +0100
+++ DGND3700/userspace/ap/gpl/strace-4.7/Makefile	2013-02-16 18:01:40.057082283 +0000
@@ -0,0 +1,3 @@
+all:
+	./configure --host=mips-linux
+	make

targets_buildFS.patch

--- DGND3700/targets/buildFS.orig	2011-10-31 02:01:47.000000000 +0000
+++ DGND3700/targets/buildFS	2013-02-28 17:51:26.147972419 +0000
@@ -120,6 +120,7 @@
 ln -s /var/log/log $ROOTFS/dev/log
 ln -s /var/sysmsg $ROOTFS/etc/sysmsg
 ln -s /var/passwd $ROOTFS/etc/passwd
+ln -s /var/shadow $ROOTFS/etc/shadow
 ln -s /var/group $ROOTFS/etc/group
 ln -s /var/ppp/pppmsg $ROOTFS/etc/pppmsg
 ln -s /var/fyi/sys/dns $ROOTFS/etc/resolv.conf
@@ -130,6 +132,22 @@
 ln -s /var/ipsec/racoon.conf $ROOTFS/etc/racoon.conf
 ln -s /var/ipsec/psk.txt $ROOTFS/etc/psk.txt
 ln -s /var/iproute2/rt_tables $ROOTFS/etc/iproute2/rt_tables
+
+# Create missing symlinks
+pushd $ROOTFS/bin
+ln -s xdslctl adsl
+ln -s xdslctl adslctl
+ln -s cmfctl cmf
+ln -s xtmctl dumpmem
+ln -s fcctl fc
+ln -s nas nas4not
+ln -s xtmctl setmem
+ln -s xtmctl xtm
+popd
+
+pushd $ROOTFS/dev
+ln -s vcsa0 vcsa
+popd
 # 
 #ln -s /var/tmp $ROOTFS/tmp
 #Foxconn add, FredPeng, 2007/07/26

targets_makeDevs.patch

--- DGND3700/targets/makeDevs.orig	2011-10-31 02:01:47.000000000 +0000
+++ DGND3700/targets/makeDevs	2013-03-02 16:43:57.075328749 +0000
@@ -38,6 +38,10 @@
 mknod $ROOTFS/dev/random c 1 8
 mknod $ROOTFS/dev/hwrandom c 10 183
 
+#mknod for conspy
+mknod $ROOTFS/dev/vcsa0 c 7 0
+mknod $ROOTFS/dev/vcsa1 c 7 1
+mknod $ROOTFS/dev/vcsa2 c 7 2
 
 # Create Broadcom specific devices

transmission_Makefile.in.patch

--- DGND3700/userspace/ap/gpl/transmission-2.77/Makefile.in.orig	2013-01-09 01:33:27.714140000 +0000
+++ DGND3700/userspace/ap/gpl/transmission-2.77/Makefile.in	2013-02-13 18:54:55.653030577 +0000
@@ -739,7 +739,12 @@
 all-am: Makefile
 installdirs: installdirs-recursive
 installdirs-am:
-install: install-recursive
+install:
+	echo "Copying Transmission binary and web pages"
+	$(STRIP) daemon/.libs/transmission-daemon
+	cp -a daemon/.libs/transmission-daemon $(TARGETDIR)/bin/
+	mkdir -p $(TARGETDIR)/usr/local/share/transmission
+	cp -aR web $(TARGETDIR)/usr/local/share/transmission/
 install-exec: install-exec-recursive
 install-data: install-data-recursive
 uninstall: uninstall-recursive

transmission_Makefile.patch

--- DGND3700/userspace/ap/gpl/transmission-2.77/Makefile.orig	1970-01-01 01:00:00.000000000 +0100
+++ DGND3700/userspace/ap/gpl/transmission-2.77/Makefile	2013-02-13 16:10:39.718956427 +0000
@@ -0,0 +1,11 @@
+all:
+	./configure --host=mips-linux --enable-utp --without-gtk --disable-cli --disable-nls --disable-mac --enable-daemon \
+	--with-zlib-includes="$(BUILD_DIR)/userspace/ap/gpl/minidlna/zlib-1.2.3" \
+	LIBCURL_LIBS="-L$(BUILD_DIR)/userspace/ap/gpl/curl-7.29.0/lib -lcurl" \
+	LIBCURL_CFLAGS="-I$(BUILD_DIR)/userspace/ap/gpl/curl-7.29.0/include" \
+	LIBEVENT_LIBS="-L$(BUILD_DIR)/userspace/ap/gpl/libevent-2.0.21-stable -levent" \
+	LIBEVENT_CFLAGS="-I$(BUILD_DIR)/userspace/ap/gpl/libevent-2.0.21-stable/include" \
+	OPENSSL_LIBS="-L$(BUILD_DIR)/userspace/public/libs/openssl -lcrypto -lssl" \
+	OPENSSL_CFLAGS="-I$(BUILD_DIR)/userspace/public/libs/openssl/include" \
+	LDFLAGS="-L$(BUILD_DIR)/userspace/ap/gpl/minidlna/zlib-1.2.3"
+	make

userspace_ap_gpl_config.in.patch

--- DGND3700/userspace/ap/gpl/config.in.orig	2013-02-26 20:56:27.703604950 +0000
+++ DGND3700/userspace/ap/gpl/config.in	2013-02-26 20:57:15.040214901 +0000
@@ -65,7 +65,7 @@
 ACOSTOPDIR= $(BUILD_DIR)/userspace/ap/acos
 export ACOSTOPDIR
 
-export CFLAGS +=  -DU12L146
+export CFLAGS +=  -DU12L146 -O2 -march=mips32  -fomit-frame-pointer -fno-strict-aliasing -mabi=32 -G 0 -msoft-float -pipe -Wa,-mips32
 
 export LIB_NAT_CFLAGS += -DINCLUDE_WAN_LAN_SUBNET -DAG_QOS -DBANDWIDTH_DETECT

userspace_gpl_apps_Makefile.patch

--- DGND3700/userspace/gpl/apps/Makefile.orig	2011-10-20 10:57:36.000000000 +0100
+++ DGND3700/userspace/gpl/apps/Makefile	2013-02-24 20:25:25.139558021 +0000
@@ -76,9 +76,9 @@
 ifneq ($(strip $(BUILD_BUSYBOX)),)
 busybox: sanity_check
 	mkdir -p $(INSTALL_DIR)/bin
-	(tar xkfj busybox.tar.bz2 2> /dev/null || true)
-	cd busybox; cp -f $(BUSYBOX_CONFIG) .config
-	$(MAKE) -C busybox install
+	#(tar xkfj busybox.tar.bz2 2> /dev/null || true)
+	#cd busybox; cp -f $(BUSYBOX_CONFIG) .config
+	$(MAKE) CONFIG_PREFIX=$(INSTALL_DIR) -C busybox-1.21.0 install
 else
 busybox: sanity_check
 	@echo "skipping busybox (not configured)"

userspace_project_gpl_Makefile.patch

--- DGND3700/userspace/project/gpl/Makefile.orig	2013-02-27 17:32:36.559379146 +0000
+++ DGND3700/userspace/project/gpl/Makefile	2013-02-27 17:34:08.392966362 +0000
@@ -60,7 +60,7 @@
 
 # pling added 05/04/2009, for NTFS-3g
 ifeq ($(CONFIG_NTFS_3G),y)
-SUBDIRS += ntfs-3g-2009.3.8
+SUBDIRS += ntfs-3g_ntfsprogs-2013.1.13
 endif
 #pling added 05/07/2009, for mtools (to read FAT volume label)
 ifeq ($(CONFIG_MTOOLS),y)
@@ -79,6 +79,15 @@
 SUBDIRS += openswan-2.4.9
 endif
 
+SUBDIRS += curl-7.29.0
+SUBDIRS += libevent-2.0.21-stable
+SUBDIRS += transmission-2.77
+SUBDIRS += strace-4.7
+SUBDIRS += nat5
+SUBDIRS += dropbear-2012.55
+
+
+
 all:
 	for i in ${SUBDIRS}; do \
 		(cd $$i; make) || exit 1; \

quickly regenerate above patch list

This is just for my own benefit to generate the above quickly

for i in $(ls *.patch) ; do echo -e "\n==$i==\n\n<syntaxhighlight enclose=\"div\" lang=\"diff\">" >> /tmp/p.txt  ; cat $i >> /tmp/p.txt; 
echo -e "</syntaxhighlight>" >>  /tmp/p.txt  ; done

Comments

blog comments powered by Disqus



Disclaimer

Disclaimer: This site has no relationship with Netgear Corporation nor sponsored and endorsed by Netgear Corporation to post these informations. If you feel that this site has represent in manner which does not correspond to notnetgear @ richud . com Trademark & Advertising Guidelines" (section II-B)