diff -crN openwrt-firmware-master.SUDOMESH/build openwrt-firmware-master.DEEKOO/build
*** openwrt-firmware-master.SUDOMESH/build	2013-11-22 02:14:27.000000000 -0800
--- openwrt-firmware-master.DEEKOO/build	2013-11-23 14:07:43.387430748 -0800
***************
*** 1,4 ****
! #!/bin/sh
  
  # based on: 
  # https://github.com/wlanslovenija/firmware-core/blob/master/scripts/build
--- 1,4 ----
! #!/bin/bash
  
  # based on: 
  # https://github.com/wlanslovenija/firmware-core/blob/master/scripts/build
***************
*** 177,180 ****
  
  # Wait for builders
  log "Waiting for builders to finish building..."
! wait ${builder_pids}
\ No newline at end of file
--- 177,180 ----
  
  # Wait for builders
  log "Waiting for builders to finish building..."
! wait ${builder_pids}
diff -crN openwrt-firmware-master.SUDOMESH/Changes.txt openwrt-firmware-master.DEEKOO/Changes.txt
*** openwrt-firmware-master.SUDOMESH/Changes.txt	1969-12-31 16:00:00.000000000 -0800
--- openwrt-firmware-master.DEEKOO/Changes.txt	2013-11-30 11:46:08.359758398 -0800
***************
*** 0 ****
--- 1,16 ----
+ Changes made:
+  * build script uses /bin/bash instead of /bin/sh
+  * Patches the openwrt telnetd to accept a -I interfacename option
+    (in openwrt_addons/package/busybox/patches/960-telnetd-bindtodevice.diff)
+  * refactored check to see if root PW is set into files/lib/functions/auth.sh
+  * files/etc/init.d/telnet now sets the -I eth0 option, and will set the
+    IP default TTL to 1 if the root PW isn't set.
+  * files/etc/hotplug.d/iface/20-ntpclient will only be run if the root PW has
+    been set.
+  * prepare - copies openwrt_addons into built_firmware/openwrt/ before
+    building; now just copies openwrt_config/feeds.conf into the build dir,
+    moving the old one to feeds.conf.old if they differed.  This fixes the
+    bug where re-running prepare would cause piles of spurious errors as
+    feeds.conf grew.
+ 
+  - Deekoo 2013 Nov 30
diff -crN openwrt-firmware-master.SUDOMESH/files/etc/hotplug.d/iface/20-ntpclient openwrt-firmware-master.DEEKOO/files/etc/hotplug.d/iface/20-ntpclient
*** openwrt-firmware-master.SUDOMESH/files/etc/hotplug.d/iface/20-ntpclient	1969-12-31 16:00:00.000000000 -0800
--- openwrt-firmware-master.DEEKOO/files/etc/hotplug.d/iface/20-ntpclient	2013-11-28 20:02:55.539843058 -0800
***************
*** 0 ****
--- 1,83 ----
+ #!/bin/sh
+ # Copyright (C) 2006 OpenWrt.org
+ 
+ . /lib/functions.sh
+ . /lib/functions/auth.sh
+ 
+ unset SERVER
+ unset PORT
+ unset INTERVAL
+ unset COUNT
+ unset INTERFACE_GLOBAL
+ 
+ NTPC=`which ntpclient`
+ 
+ check_server() {
+ 	local hostname
+ 	local port
+ 	local interface
+ 	[ -n "$SERVER" ] && return
+ 	config_get hostname $1 hostname
+ 	config_get port $1 port
+ 	config_get interface $1 interface
+ 
+ 	[ -z "$interface" ] && interface=$INTERFACE_GLOBAL
+ 
+ 	[ -n "$interface" ] && {
+ 		# $INTERFACE is passed from hotplug event
+ 		[ "$interface" = "$INTERFACE" ] || return
+ 	}
+ 
+ 	[ -z "$hostname" ] && return
+ 	$NTPC -c 1 -p ${port:-123} -i 2 -h $hostname > /dev/null && { SERVER=$hostname; PORT=${port:-123}; }
+ }
+ 
+ set_drift() {
+ 	config_get freq $1 freq
+ 	[ -n "$freq" ] && adjtimex -f $freq >/dev/null
+ }
+ 
+ start_ntpclient() {
+ 	if ( root_password_not_set ) ;
+ 	then
+ 		exit 0
+ 	fi
+ 	config_foreach set_drift ntpdrift
+ 	config_foreach check_server ntpserver
+ 	[ -z "$SERVER" ] && exit 0
+ 	logger starting ntpclient
+ 	$NTPC ${COUNT:+-c $COUNT} ${INTERVAL:+-i $INTERVAL} -s -l -D -p $PORT -h $SERVER 2> /dev/null
+ }
+ 
+ stop_ntpclient() {
+ 	logger stopping ntpclient
+ 	killall ntpclient
+ }
+ 
+ load_settings() {
+ 	local interval
+ 	local count
+ 	local iface
+ 	
+ 	config_get interval $1 interval
+ 	config_get count $1 count
+ 	config_get interface $1 interface
+ 	
+ 	[ -n "$count" ] && COUNT=$count
+ 	[ -n "$interval" ] && INTERVAL=$interval
+ 	[ -n "$interface" ] && INTERFACE_GLOBAL=$interface
+ }
+ 
+ config_load ntpclient
+ config_foreach load_settings ntpclient
+ 
+ NTP_RUNNING=`ps  | grep $NTPC | grep -v grep`
+ 
+ case "${ACTION:-ifup}" in
+ 	ifup)
+ 		[ -z "$NTP_RUNNING" ] && start_ntpclient 
+ 	;;
+ 	ifdown)
+ 		[ -n "$NTP_RUNNING" ] && stop_ntpclient 
+ 	;;
+ esac
diff -crN openwrt-firmware-master.SUDOMESH/files/etc/init.d/telnet openwrt-firmware-master.DEEKOO/files/etc/init.d/telnet
*** openwrt-firmware-master.SUDOMESH/files/etc/init.d/telnet	1969-12-31 16:00:00.000000000 -0800
--- openwrt-firmware-master.DEEKOO/files/etc/init.d/telnet	2013-11-28 19:37:09.155800716 -0800
***************
*** 0 ****
--- 1,18 ----
+ #!/bin/sh /etc/rc.common
+ # Copyright (C) 2006-2011 OpenWrt.org
+ 
+ . /lib/functions/auth.sh
+ 
+ START=50
+ 
+ start() {
+ 	if ( root_password_not_set) ;
+ 	then
+ 		echo 1 >/proc/sys/net/ipv4/ip_default_ttl
+ 		service_start /usr/sbin/telnetd -I eth0 -l /bin/login.sh
+ 	fi
+ }
+ 
+ stop() {
+ 	service_stop /usr/sbin/telnetd
+ }
diff -crN openwrt-firmware-master.SUDOMESH/files/lib/functions/auth.sh openwrt-firmware-master.DEEKOO/files/lib/functions/auth.sh
*** openwrt-firmware-master.SUDOMESH/files/lib/functions/auth.sh	1969-12-31 16:00:00.000000000 -0800
--- openwrt-firmware-master.DEEKOO/files/lib/functions/auth.sh	2013-11-30 11:34:40.803739572 -0800
***************
*** 0 ****
--- 1,29 ----
+ #!/bin/sh
+ # Copyright (C) 2006-2011 OpenWrt.org
+ 
+ has_root_pwd() {
+ 	local pwd=$([ -f "$1" ] && cat "$1")
+ 	      pwd="${pwd#*root:}"
+ 	      pwd="${pwd%%:*}"
+ 
+ 	test -n "${pwd#[\!x]}"
+ }
+ 
+ get_root_home() {
+ 	local homedir=$([ -f "$1" ] && cat "$1")
+ 	homedir="${homedir#*:*:0:0:*:}"
+ 
+ 	echo "${homedir%%:*}"
+ }
+ 
+ has_ssh_pubkey() {
+ 	( /etc/init.d/dropbear enabled 2> /dev/null && grep -qs "^ssh-" /etc/dropbear/authorized_keys ) || \
+ 	( /etc/init.d/sshd enabled 2> /dev/null && grep -qs "^ssh-" "$(get_root_home /etc/passwd)"/.ssh/authorized_keys )
+ }
+ 
+ 
+ root_password_not_set() {
+ 	( ! has_ssh_pubkey && \
+ 	     ! has_root_pwd /etc/passwd && ! has_root_pwd /etc/shadow ) || \
+ 	   ( ! /etc/init.d/dropbear enabled 2> /dev/null && ! /etc/init.d/sshd enabled 2> /dev/null )
+ 	}
diff -crN openwrt-firmware-master.SUDOMESH/openwrt_addons/package/busybox/patches/960-telnetd-bindtodevice.diff openwrt-firmware-master.DEEKOO/openwrt_addons/package/busybox/patches/960-telnetd-bindtodevice.diff
*** openwrt-firmware-master.SUDOMESH/openwrt_addons/package/busybox/patches/960-telnetd-bindtodevice.diff	1969-12-31 16:00:00.000000000 -0800
--- openwrt-firmware-master.DEEKOO/openwrt_addons/package/busybox/patches/960-telnetd-bindtodevice.diff	2013-11-29 14:35:25.245670757 -0800
***************
*** 0 ****
--- 1,60 ----
+ *** busybox-1.19.4.orig/networking/telnetd.c	2013-11-28 16:58:20.959539821 -0800
+ --- busybox-1.19.4/networking/telnetd.c	2013-11-26 19:50:36.907091332 -0800
+ ***************
+ *** 33,38 ****
+ --- 33,39 ----
+   //usage:	IF_FEATURE_TELNETD_STANDALONE(
+   //usage:     "\n	-p PORT		Port to listen on"
+   //usage:     "\n	-b ADDR[:PORT]	Address to bind to"
+ + //usage:     "\n	-I interface	Interface to bind to"
+   //usage:     "\n	-F		Run in foreground"
+   //usage:     "\n	-i		Inetd mode"
+   //usage:	IF_FEATURE_TELNETD_INETD_WAIT(
+ ***************
+ *** 493,498 ****
+ --- 494,500 ----
+   	int sec_linger = sec_linger;
+   	char *opt_bindaddr = NULL;
+   	char *opt_portnbr;
+ + 	char *opt_bindinterface = NULL;
+   #else
+   	enum {
+   		IS_INETD = 1,
+ ***************
+ *** 506,515 ****
+   	/* Even if !STANDALONE, we accept (and ignore) -i, thus people
+   	 * don't need to guess whether it's ok to pass -i to us */
+   	opt = getopt32(argv, "f:l:Ki"
+ ! 			IF_FEATURE_TELNETD_STANDALONE("p:b:F")
+   			IF_FEATURE_TELNETD_INETD_WAIT("Sw:"),
+   			&G.issuefile, &G.loginpath
+ ! 			IF_FEATURE_TELNETD_STANDALONE(, &opt_portnbr, &opt_bindaddr)
+   			IF_FEATURE_TELNETD_INETD_WAIT(, &sec_linger)
+   	);
+   	if (!IS_INETD /*&& !re_execed*/) {
+ --- 508,517 ----
+   	/* Even if !STANDALONE, we accept (and ignore) -i, thus people
+   	 * don't need to guess whether it's ok to pass -i to us */
+   	opt = getopt32(argv, "f:l:Ki"
+ ! 			IF_FEATURE_TELNETD_STANDALONE("p:b:FI:")
+   			IF_FEATURE_TELNETD_INETD_WAIT("Sw:"),
+   			&G.issuefile, &G.loginpath
+ ! 			IF_FEATURE_TELNETD_STANDALONE(, &opt_portnbr, &opt_bindaddr, &opt_bindinterface)
+   			IF_FEATURE_TELNETD_INETD_WAIT(, &sec_linger)
+   	);
+   	if (!IS_INETD /*&& !re_execed*/) {
+ ***************
+ *** 539,544 ****
+ --- 541,552 ----
+   			if (opt & OPT_PORT)
+   				portnbr = xatou16(opt_portnbr);
+   			master_fd = create_and_bind_stream_or_die(opt_bindaddr, portnbr);
+ + 			if (opt_bindinterface) {
+ + 				if (setsockopt(master_fd, SOL_SOCKET, SO_BINDTODEVICE, opt_bindinterface, strlen(opt_bindinterface))) {
+ + 					fprintf(stderr,"Error binding to interface %s\n",opt_bindinterface);
+ + 					return 1;
+ + 				}
+ + 			}
+   			xlisten(master_fd, 1);
+   		}
+   		close_on_exec_on(master_fd);
diff -crN openwrt-firmware-master.SUDOMESH/openwrt_config/feeds.conf openwrt-firmware-master.DEEKOO/openwrt_config/feeds.conf
*** openwrt-firmware-master.SUDOMESH/openwrt_config/feeds.conf	1969-12-31 16:00:00.000000000 -0800
--- openwrt-firmware-master.DEEKOO/openwrt_config/feeds.conf	2013-11-29 12:15:51.073441460 -0800
***************
*** 0 ****
--- 1,4 ----
+ src-git peopleswifi git://github.com/sudomesh/openwrt-packages.git
+ src-git luci git://nbd.name/luci.git
+ src-svn openwrt svn://svn.openwrt.org/openwrt/packages
+ src-git routing git://github.com/openwrt-routing/packages.git;for-12.09.x
diff -crN openwrt-firmware-master.SUDOMESH/prepare openwrt-firmware-master.DEEKOO/prepare
*** openwrt-firmware-master.SUDOMESH/prepare	2013-11-22 02:14:27.000000000 -0800
--- openwrt-firmware-master.DEEKOO/prepare	2013-11-29 12:44:56.221489245 -0800
***************
*** 50,55 ****
--- 50,59 ----
    fi
    echo "Purging .svn files from repository"
    find ${OPENWRT_CHECKOUT_DIR} -name .svn -type d -exec rm -rf "{}" \; 2>/dev/null
+ 
+   echo "Adding extra files."
+   cp -r openwrt_addons/* "${OPENWRT_CHECKOUT_DIR}"
+ 
  fi
  
  
***************
*** 61,91 ****
  # Inject feeds and configurations
  echo "Configuring feeds"
  
! feedlines=()
! feed_file="${workdir}/openwrt_config/feeds"
! while read -r line
! do
!   feedlines=("${feedlines[@]}" "${line}")
! done < "$feed_file"
! 
! feed_titles=()
! feed_sources=()
! for feedline in "${feedlines[@]}"; do
!   IFS=: read -a ARRAY <<< "${feedline}" 
!   feed_title=${ARRAY[*]:0:1}
!   feed_titles=("${feed_titles[@]}" "${feed_title}")
! 
!   SAVE_IFS=$IFS
!   IFS=":"
!   feed_source="${ARRAY[*]:1}"
!   IFS=$SAVE_IFS
! 
!   feed_sources=("${feed_sources[@]}" "${feed_source}")
! done
! 
! for feed_source in "${feed_sources[@]}"; do
!   echo "${feed_source}"  >> ${OPENWRT_CHECKOUT_DIR}/feeds.conf    
! done
  
  package_names=()
  packages_file="${workdir}/openwrt_config/packages"
--- 65,75 ----
  # Inject feeds and configurations
  echo "Configuring feeds"
  
! cmp "${workdir}/openwrt_config/feeds.conf" "${OPENWRT_CHECKOUT_DIR}/feeds.conf" || (
! 	echo "Saving old feeds.conf in ${OPENWRT_CHECKOUT_DIR}/feeds.conf.old"
! 	mv "${OPENWRT_CHECKOUT_DIR}/feeds.conf" "${OPENWRT_CHECKOUT_DIR}/feeds.conf.old"
! )
! cp "${workdir}/openwrt_config/feeds.conf" "${OPENWRT_CHECKOUT_DIR}/feeds.conf"
  
  package_names=()
  packages_file="${workdir}/openwrt_config/packages"
