DGND3700 V1 Transmission Firmware Additions

From richud.com
Jump to navigation Jump to search

Additions

(Old) Build files from DGND3700_10121522_A_D.chk 12/Oct/2013 below

adsl.sh

#!/bin/sh
/bin/adslctl profile --show > /tmp/profile_show

for line in $(cat /tmp/profile_show | tr " \t" "#")
do

	case "$line" in
		"#G.Dmt#Enabled") mod=${mod}d ;;
		"#G.lite#Enabled") mod=${mod}l ;;
		"#T1.413#Enabled") mod=${mod}t ;;
		"#ADSL2#Enabled") mod=${mod}2 ;;
		"#AnnexL#Enabled") mod=${mod}e ;;
		"#ADSL2+#Enabled") mod=${mod}p ;;
		"#AnnexM#Enabled") mod=${mod}mM3M5 ;;
		"#VDSL2#Enabled") mod=${mod}v ;;
		*pair) lpair=$(echo $line | sed "s@#\([A-Za-z]\).*@\1@");;
		"#bitswap#"*) bitswap=$(echo $line | sed "s@.*#\([Onf]*\)@\1@") ;;
		"#sra#"*) sra=$(echo $line | sed "s@.*#\([Onf]*\)@\1@") ;;
		"#trellis#"*) trellis=$(echo $line | sed "s@.*#\([Onf]*\)@\1@") ;;
		"#sesdrop#"*) sesdrop=$(echo $line | sed "s@.*#\([Onf]*\)@\1@") ;;
		"#CoMinMgn#"*) CoMinMgn=$(echo $line | sed "s@.*#\([Onf]*\)@\1@") ;;
		"#24k#"*) i24k=$(echo $line | sed "s@.*#\([Onf]*\)@\1@") ;;
		"#phyReXmt(Us/Ds)#Off/Off") phyReXmt=0;;
		"#phyReXmt(Us/Ds)#Off/On") phyReXmt=1;;
		"#phyReXmt(Us/Ds)#On/Off") phyReXmt=2;;
		"#phyReXmt(Us/Ds)#On/On") phyReXmt=3;;
		"#monitorTone:#"*) monitorTone=$(echo $line | sed "s@.*#\([Onf]*\)@\1@") ;;
		"#dynamicD:#"*) dynamicD=$(echo $line | sed "s@.*#\([Onf]*\)@\1@") ;;
		"#dynamicF:#"*) dynamicF=$(echo $line | sed "s@.*#\([Onf]*\)@\1@") ;;
		"#SOS:#"*) SOS=$(echo $line | sed "s@.*#\([Onf]*\)@\1@") ;;
		"#Training"*) snr=$(echo $line | sed "s@.*#\([-0-9]*\).*@\1@");[ "$snr" = "-1" ] && snr=100;;
	esac
done


echo "
<html><head>
<style type='text/css'>
.prgbar { font-family:Arial; padding:0px; height: 20px; width: 200px; font-weight: bolder; font-size: 10pt; color: #0000FF}
select { width:175px;}
</style>

<script type='text/javascript'>
	//object of current values
	var arr = new Array();
	arr['mod'] = '${mod}'
	arr['lpair'] = '${lpair}'
	arr['bitswap'] = '${bitswap}'
	arr['sra'] = '${sra}'
	arr['trellis'] = '${trellis}'
	arr['sesdrop'] = '${sesdrop}'
	arr['CoMinMgn'] = '${CoMinMgn}'
	arr['i24k'] = '${i24k}'
	arr['phyReXmt'] = '${phyReXmt}'
	arr['monitorTone'] = '${monitorTone}'
	arr['dynamicD'] = '${dynamicD}'
	arr['dynamicF'] = '${dynamicF}'
	arr['SOS'] = '${SOS}'
	arr['snr'] = '${snr}'

onload=function(){
	//change all values
	var s=''
	for(k in arr){
		e = document.getElementById(k)
		for (j = 0; j < e.length; j++) {
			if (e.options[j].value == arr[k]) {e.selectedIndex = j}
		}
		s=s+'--'+k+' '+e.options[e.selectedIndex].value+' '
	}
	document.getElementById('dlna').media_server_name.value=s
}

function update(){
	//update string on change
	var s=''
	for(k in arr){
		e = document.getElementById(k)
		if (e.value !== '') {
			s=s+'--'+k+' '+e.options[e.selectedIndex].value+' '
		}
		
	}
	document.getElementById('dlna').media_server_name.value=s

}

function go(){
	//submit changes
	d=document.getElementById('dlna')
	update()
	d.media_server_name.value='adslset#'+d.media_server_name.value
	d.submit()
	tick()
	setTimeout(function(){location.reload(true)},5000)
}

function tick()
{
	document.getElementById('body').innerHTML='<center><h1><%301%></h1><form name=tik><input type=text name=tick class=prgbar></form>'
	setInterval('document.forms[\'tik\'].tick.value += \'|\'',100)
}

</SCRIPT>
<link rel=stylesheet href=form.css>
</head>
<body>

<iframe name=ifr style='visibility:hidden;display:none' height=0 width=0></iframe>

<DIV id=body>

<table border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr>
	<td colspan=2><h1>ADSL Advanced Settings</h1></td>
</tr>

<tr>
	<td colspan=2 background=liteblue.gif height=12>&nbsp; </td>
</tr>

<tr>
	<td width=100>SNR Margin</td>
	<td>
		<select id=snr>
		<option value=200>+6dB (+Stability)</option>
		<option value=150>+3dB</option>
		<option value=100 selected>+0dB (Default)</option>
		<option value=50>-3dB</option>
		<option value=25>-4.5dB</option>
		<option value=1>-5.5dB</option>
		<option value=65500>-9dB</option>
		<option value=65480>-9.5dB</option>
		<option value=65450>-12dB (+Speed)</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>DSL Modulation</td>
	<td>
	<!--
	netgears www settings mixup sets xdslctl thusly
	Auto = dlt2pem
	DSL = dlt
	ADSL2 = 2m
	ADSL2+ = pm
	VDSL = just sets auto
	//-->
		<select id=mod>
		<option value=>(Default)</option>
		<option value=dlt2epmM3M5v>All Enabled</option>
		<option value=d>ADSL G.Dmt</option>
		<option value=l>ADSL G.lite</option>
		<option value=t>ADSL T1.413</option>
		<option value=2>ADSL2</option>
		<option value=e>ADSL2 Annex L</option>
		<option value=p>ADSL2+</option>
		<option value=mM3M5>ADSL2+ AnnexM</option>
		<option value=v>VDSL2</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>Phone Line Pair</td>
	<td>
		<select id=lpair>
		<option value=i selected>Inner (Default)</option>
		<option value=o>Outer</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>Bitswap</td>
	<td>
		<select id=bitswap>
		<option value=off>Off</option>
		<option value=on selected>On (Default)</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>Sra</td>
	<td>
		<select id=sra>
		<option value=off selected>Off (Default)</option>
		<option value=on>On</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>Trellis</td>
	<td>
		<select id=trellis>
		<option value=off>Off</option>
		<option value=on selected>On (Default)</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>Sesdrop</td>
	<td>
		<select id=sesdrop>
		<option value=off selected>Off (Default)</option>
		<option value=on>On</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>CoMinMgn</td>
	<td>
		<select id=CoMinMgn>
		<option value=off selected>Off (Default)</option>
		<option value=on>On</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>i24k</td>
	<td>
		<select id=i24k>
		<option value=off>Off</option>
		<option value=on selected>On (Default)</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>phyReXmt</td>
	<td>
		<select id=phyReXmt>
		<option value=0>Up Off/Down Off</option>
		<option value=1 selected>Up Off/Down On(Default)</option>
		<option value=2>Up On/Down Off</option>
		<option value=3>Up On/Down On</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>monitorTone</td>
	<td>
		<select id=monitorTone>
		<option value=off>Off</option>
		<option value=on selected>On (Default)</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>dynamicD</td>
	<td>
		<select id=dynamicD>
		<option value=off>Off</option>
		<option value=on selected>On (Default)</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>dynamicF</td>
	<td>
		<select id=dynamicF>
		<option value=off selected>Off (Default)</option>
		<option value=on>On</option>
		</select>
	</td>
</tr>

<tr>
	<td width=100>SOS</td>
	<td>
		<select id=SOS>
		<option value=off>Off</option>
		<option value=on selected>On (Default)</option>
		</select>
	</td>
</tr>

<tr>
	<td colspan=2><br>
		<form id=dlna method=POST action=dlna.cgi target=ifr>
		<input type=hidden name=enable_ms value=1>
		<input type=hidden name=ms_active_status value=1>
		<input type=hidden name=media_server_name>
		<input type=button value=Apply onClick=go()>
		</form>
	</td>

</tr>
</table>




<table border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr>
	<td background=liteblue.gif height=12>&nbsp; </td>
</tr>



<tr>
	<td><h1>ADSL Profile</h1></td>
</tr>

<tr>
	<td>
		<input type=button value='Show/Hide' onclick=\"document.getElementById('prof').style.display=(document.getElementById('prof').style.display=='block')?'none':'block';return false;\"><br>
		<div id=prof style='display:none;'><br>
		&nbsp;&nbsp;&nbsp;<span class=thead>/tmp/profile_show</span><br>
		<object style='width:100%; height:350px;' data='profile_show'></object>
		</div>
	</td>
</tr>

<tr>
	<td background=liteblue.gif height=12>&nbsp; </td>
</tr>

<tr>
	<td><h1>ADSL State</h1></td>
</tr>
<tr>
	<td>
		<input type=button value='Show/Hide' onclick=\"document.getElementById('stat').style.display=(document.getElementById('stat').style.display=='block')?'none':'block';return false;\"><br>
		<div id=stat style='display:none;'><br>
		&nbsp;&nbsp;&nbsp;<span class=thead>/tmp/dsl_info_file</span><br>
		<object style='width:100%; height:650px;' data='dsl_info_file'></object>
		</div>
	</td>
</tr>

<tr>
	<td background=liteblue.gif height=12>&nbsp; </td>
</tr>

</table>
</DIV>
</BODY>
</html>
" > /www/adsl.htm

automatic.sh

#!/bin/sh

media_dir=/media

do_sanity()
{

	[[ "$(param get automatic_enable)" = "1" ]] || exit 1
	param set automatic_state=0
	tmiss=$(find $media_dir -maxdepth 2 -follow -type d -iname "transmissionbt")
	[[ "$tmiss" ]] || exit 1

}

do_config()
{
	[[ ! -e "$tmiss/automatic.state" ]] && touch "$tmiss/automatic.state"
	[[ ! -e "$tmiss/automatic.log" ]] && touch "$tmiss/automatic.log"
	[[ ! -e "/var/automatic.log" ]] && ln -s "$tmiss/automatic.log" "/var/automatic.log"
	if [ ! -e "$tmiss/automatic.data" ]
	then
		for i in 1 2 3 4 5 6
		do
			echo "	
			feed = {
			url$i => \"\"
			}
			filter = {
			pattern$i => \"\"
			folder$i => \"\"
			}" >> "$tmiss/automatic.data"
		done
	fi
	if [ ! -e "$tmiss/automatic.settings" ]
	then
		echo "
		rpc-port = 55555
		use-transmission = \"yes\"
		start-torrents = \"yes\"
		prowl-apikey = \"\"
		rpc-auth = \"\"
		interval = 30
		torrent-folder = \"$tmiss/torrents\"
		statefile = \"$tmiss/automatic.state\"" >> "$tmiss/automatic.settings"
	fi
	cat "$tmiss/automatic.settings" | tr -d "\t" | sed "s#/.*/transmissionbt/#$tmiss/#g" > "$tmiss/automatic.conf" #fixes any path changes
 	grep -v '""' "$tmiss/automatic.data" | tr -d "\t" | sed '/{/ {N;/}/ {/.*/d}}' | sed -e "s#^\([a-z]\+*\)[0-9]#\1#" -e "/^folder/s#\"\(.\+\)\"#\"$tmiss/Downloads/\1\"#" >> "$tmiss/automatic.conf" #strip numbering, create real paths
}

do_restart()
{
	pidof automatic && { killall -HUP automatic && param set automatic_state=1; } || do_start
}

do_start()
{
	[[ "$(ls ${media_dir})" ]] || exit 1
	nice -n 18 /bin/automatic -v2 -c "$tmiss/automatic.conf" -l "$tmiss/automatic.log" && param set automatic_state=1
}

do_stop()
{	
	/bin/sync
	killall automatic
	sleep 1
	killall -9 automatic
	param set automatic_state=0
}


case "$1" in
  start)
	do_sanity
	do_config
        do_start
        ;;
  stop)
        do_stop
        ;;
  restart)
	do_sanity
	do_config
        do_restart
        ;;
esac

automount.sh

#!/bin/sh

media_dir=/media

my_blkid()
{
	#get $UUID/$TYPE/$LABEL/$TYPE from blkid
	eval $(blkid /dev/${MDEV} | cut -d":" -f2-)

	[[ "${TYPE}" ]] || { logger -t automount.sh "FAIL my_blkid ${MDEV} ${ACTION} ${LABEL} ${UUID} ${MP}";exit 1; }

	#change scheduler for slow disk
	echo cfq > /sys/block/${MDEV%[0-9]}/queue/scheduler

	for i in "${LABEL}" "${UUID}" "${MDEV}"
	do
		j=$(echo $i | tr -dc '[A-Za-z0-9_ .\-()@#~+=]')
		[[ "$j" ]] && MP="${media_dir}/$j" && break
	done

	#debug
	logger -t automount.sh "DEBUG my_blkid ${MDEV} ${ACTION} ${LABEL} ${UUID} ${MP}"
}


my_services()
{
	#stop/start/restart services
	for i in samba nfsd transmission minidlna automatic
		do
			/etc/init.d/${i}.sh $1
		done
	/etc/services.sh
}


my_umount_all()
{	
	sed -n 's#^/dev/sd[^ ]\+ \(/media/[^ ]\+\) .*#\1#p' /proc/mounts | while read i
	do
		do_umount "$i"
	done
}


my_umount()
{
	p=$(grep -s "^/dev/${MDEV} " /proc/mounts)
	[[ "$p" ]] && { h=${p#* };i=${h%% *};do_umount '$i'; }
}


do_umount()
{
	/bin/sync
	#bug stops umount unmounting via {MDEV} if mounted folder has a space
	MP=$(echo "$1" | sed "s#\\\040# #g");umount "${MP}";umount -l "${MP}";rmdir "${MP}"
}


my_mount()
{
	mkdir -p "${MP}" || { logger -t automount.sh "FAIL my_mount ${MDEV} ${ACTION} ${LABEL} ${UUID} ${MP}";exit 1; }
	mount -o noatime,rw "/dev/${MDEV}" "${MP}" && my_services 'restart' || rmdir "${MP}"
}


case "${ACTION}" in
add|"")
	my_blkid
	my_umount
	my_mount
	;;
remove)
	my_umount
	grep -qs "^/dev/${MDEV} " /proc/mounts && my_services 'restart' || my_services 'stop'
	;;
removeall)
	my_services 'stop'
	my_umount_all
	;;
esac

busybox.config

#
# Automatically generated make config: don't edit
# Busybox version: 1.21.1
# Sat Oct  5 19:05:54 2013
#
CONFIG_HAVE_DOT_CONFIG=y

#
# Busybox Settings
#

#
# General Configuration
#
# CONFIG_DESKTOP is not set
# CONFIG_EXTRA_COMPAT is not set
# CONFIG_INCLUDE_SUSv2 is not set
# CONFIG_USE_PORTABLE_CODE is not set
CONFIG_PLATFORM_LINUX=y
# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
CONFIG_SHOW_USAGE=y
CONFIG_FEATURE_VERBOSE_USAGE=y
CONFIG_FEATURE_COMPRESS_USAGE=y
# CONFIG_FEATURE_INSTALLER is not set
# CONFIG_INSTALL_NO_USR is not set
# CONFIG_LOCALE_SUPPORT is not set
CONFIG_UNICODE_SUPPORT=y
# CONFIG_UNICODE_USING_LOCALE is not set
# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
CONFIG_SUBST_WCHAR=63
CONFIG_LAST_SUPPORTED_WCHAR=767
# CONFIG_UNICODE_COMBINING_WCHARS is not set
# CONFIG_UNICODE_WIDE_WCHARS is not set
# CONFIG_UNICODE_BIDI_SUPPORT is not set
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
# CONFIG_UNICODE_PRESERVE_BROKEN is not set
CONFIG_LONG_OPTS=y
# CONFIG_FEATURE_DEVPTS is not set
# CONFIG_FEATURE_CLEAN_UP is not set
CONFIG_FEATURE_UTMP=y
CONFIG_FEATURE_WTMP=y
CONFIG_FEATURE_PIDFILE=y
CONFIG_PID_FILE_PATH="/var/run"
CONFIG_FEATURE_SUID=y
# CONFIG_FEATURE_SUID_CONFIG is not set
# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set
# CONFIG_SELINUX is not set
# CONFIG_FEATURE_PREFER_APPLETS is not set
CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
CONFIG_FEATURE_SYSLOG=y
# CONFIG_FEATURE_HAVE_RPC is not set

#
# Build Options
#
# CONFIG_STATIC is not set
# CONFIG_PIE is not set
# CONFIG_NOMMU is not set
# CONFIG_BUILD_LIBBUSYBOX is not set
# CONFIG_FEATURE_INDIVIDUAL is not set
# CONFIG_FEATURE_SHARED_BUSYBOX is not set
CONFIG_LFS=y
CONFIG_CROSS_COMPILER_PREFIX=""
CONFIG_SYSROOT=""
CONFIG_EXTRA_CFLAGS=""
CONFIG_EXTRA_LDFLAGS=""
CONFIG_EXTRA_LDLIBS=""

#
# Debugging Options
#
# CONFIG_DEBUG is not set
# CONFIG_DEBUG_PESSIMIZE is not set
# CONFIG_WERROR is not set
CONFIG_NO_DEBUG_LIB=y
# CONFIG_DMALLOC is not set
# CONFIG_EFENCE is not set

#
# Installation Options ("make install" behavior)
#
CONFIG_INSTALL_APPLET_SYMLINKS=y
# CONFIG_INSTALL_APPLET_HARDLINKS is not set
# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
# CONFIG_INSTALL_APPLET_DONT is not set
# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
CONFIG_PREFIX="./_install"

#
# Busybox Library Tuning
#
CONFIG_FEATURE_SYSTEMD=y
CONFIG_FEATURE_RTMINMAX=y
CONFIG_PASSWORD_MINLEN=6
CONFIG_MD5_SMALL=1
CONFIG_SHA3_SMALL=1
CONFIG_FEATURE_FAST_TOP=y
# CONFIG_FEATURE_ETC_NETWORKS is not set
CONFIG_FEATURE_USE_TERMIOS=y
CONFIG_FEATURE_EDITING=y
CONFIG_FEATURE_EDITING_MAX_LEN=1024
# CONFIG_FEATURE_EDITING_VI is not set
CONFIG_FEATURE_EDITING_HISTORY=255
CONFIG_FEATURE_EDITING_SAVEHISTORY=y
# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set
CONFIG_FEATURE_REVERSE_SEARCH=y
CONFIG_FEATURE_TAB_COMPLETION=y
# CONFIG_FEATURE_USERNAME_COMPLETION is not set
CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
CONFIG_FEATURE_NON_POSIX_CP=y
# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
CONFIG_FEATURE_COPYBUF_KB=4
CONFIG_FEATURE_SKIP_ROOTFS=y
# CONFIG_MONOTONIC_SYSCALL is not set
CONFIG_IOCTL_HEX2STR_ERROR=y
# CONFIG_FEATURE_HWIB is not set

#
# Applets
#

#
# Archival Utilities
#
CONFIG_FEATURE_SEAMLESS_XZ=y
CONFIG_FEATURE_SEAMLESS_LZMA=y
CONFIG_FEATURE_SEAMLESS_BZ2=y
CONFIG_FEATURE_SEAMLESS_GZ=y
# CONFIG_FEATURE_SEAMLESS_Z is not set
# CONFIG_AR is not set
# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
# CONFIG_FEATURE_AR_CREATE is not set
# CONFIG_BUNZIP2 is not set
# CONFIG_BZIP2 is not set
# CONFIG_CPIO is not set
# CONFIG_FEATURE_CPIO_O is not set
# CONFIG_FEATURE_CPIO_P is not set
# CONFIG_DPKG is not set
# CONFIG_DPKG_DEB is not set
# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
CONFIG_GUNZIP=y
CONFIG_GZIP=y
CONFIG_FEATURE_GZIP_LONG_OPTIONS=y
CONFIG_GZIP_FAST=0
CONFIG_LZOP=y
# CONFIG_LZOP_COMPR_HIGH is not set
# CONFIG_RPM2CPIO is not set
# CONFIG_RPM is not set
CONFIG_TAR=y
CONFIG_FEATURE_TAR_CREATE=y
CONFIG_FEATURE_TAR_AUTODETECT=y
# CONFIG_FEATURE_TAR_FROM is not set
CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
# CONFIG_FEATURE_TAR_TO_COMMAND is not set
CONFIG_FEATURE_TAR_UNAME_GNAME=y
CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y
# CONFIG_FEATURE_TAR_SELINUX is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_UNLZMA=y
# CONFIG_FEATURE_LZMA_FAST is not set
CONFIG_LZMA=y
CONFIG_UNXZ=y
CONFIG_XZ=y
# CONFIG_UNZIP is not set

#
# Coreutils
#
CONFIG_BASENAME=y
CONFIG_CAT=y
CONFIG_DATE=y
CONFIG_FEATURE_DATE_ISOFMT=y
# CONFIG_FEATURE_DATE_NANO is not set
CONFIG_FEATURE_DATE_COMPAT=y
# CONFIG_HOSTID is not set
# CONFIG_ID is not set
# CONFIG_GROUPS is not set
CONFIG_TEST=y
# CONFIG_FEATURE_TEST_64 is not set
CONFIG_TOUCH=y
CONFIG_FEATURE_TOUCH_SUSV3=y
CONFIG_TR=y
CONFIG_FEATURE_TR_CLASSES=y
CONFIG_FEATURE_TR_EQUIV=y
# CONFIG_BASE64 is not set
# CONFIG_WHO is not set
CONFIG_USERS=y
# CONFIG_CAL is not set
CONFIG_CATV=y
# CONFIG_CHGRP is not set
CONFIG_CHMOD=y
CONFIG_CHOWN=y
CONFIG_FEATURE_CHOWN_LONG_OPTIONS=y
# CONFIG_CHROOT is not set
CONFIG_CKSUM=y
CONFIG_COMM=y
CONFIG_CP=y
CONFIG_FEATURE_CP_LONG_OPTIONS=y
CONFIG_CUT=y
# CONFIG_DD is not set
# CONFIG_FEATURE_DD_SIGNAL_HANDLING is not set
# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
# CONFIG_FEATURE_DD_IBS_OBS is not set
CONFIG_DF=y
CONFIG_FEATURE_DF_FANCY=y
CONFIG_DIRNAME=y
CONFIG_DOS2UNIX=y
CONFIG_UNIX2DOS=y
CONFIG_DU=y
CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
CONFIG_ECHO=y
CONFIG_FEATURE_FANCY_ECHO=y
CONFIG_ENV=y
CONFIG_FEATURE_ENV_LONG_OPTIONS=y
CONFIG_EXPAND=y
CONFIG_FEATURE_EXPAND_LONG_OPTIONS=y
CONFIG_EXPR=y
CONFIG_EXPR_MATH_SUPPORT_64=y
CONFIG_FALSE=y
# CONFIG_FOLD is not set
CONFIG_FSYNC=y
CONFIG_HEAD=y
CONFIG_FEATURE_FANCY_HEAD=y
# CONFIG_INSTALL is not set
# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
CONFIG_LN=y
# CONFIG_LOGNAME is not set
CONFIG_LS=y
CONFIG_FEATURE_LS_FILETYPES=y
CONFIG_FEATURE_LS_FOLLOWLINKS=y
CONFIG_FEATURE_LS_RECURSIVE=y
CONFIG_FEATURE_LS_SORTFILES=y
CONFIG_FEATURE_LS_TIMESTAMPS=y
CONFIG_FEATURE_LS_USERNAME=y
# CONFIG_FEATURE_LS_COLOR is not set
# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
# CONFIG_MD5SUM is not set
CONFIG_MKDIR=y
CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y
# CONFIG_MKFIFO is not set
CONFIG_MKNOD=y
CONFIG_MV=y
CONFIG_FEATURE_MV_LONG_OPTIONS=y
CONFIG_NICE=y
CONFIG_NOHUP=y
# CONFIG_OD is not set
CONFIG_PRINTENV=y
# CONFIG_PRINTF is not set
CONFIG_PWD=y
# CONFIG_READLINK is not set
# CONFIG_FEATURE_READLINK_FOLLOW is not set
# CONFIG_REALPATH is not set
CONFIG_RM=y
CONFIG_RMDIR=y
CONFIG_FEATURE_RMDIR_LONG_OPTIONS=y
# CONFIG_SEQ is not set
# CONFIG_SHA1SUM is not set
CONFIG_SHA256SUM=y
# CONFIG_SHA512SUM is not set
# CONFIG_SHA3SUM is not set
CONFIG_SLEEP=y
CONFIG_FEATURE_FANCY_SLEEP=y
CONFIG_FEATURE_FLOAT_SLEEP=y
# CONFIG_SORT is not set
# CONFIG_FEATURE_SORT_BIG is not set
# CONFIG_SPLIT is not set
# CONFIG_FEATURE_SPLIT_FANCY is not set
CONFIG_STAT=y
CONFIG_FEATURE_STAT_FORMAT=y
# CONFIG_STTY is not set
CONFIG_SUM=y
CONFIG_SYNC=y
# CONFIG_TAC is not set
CONFIG_TAIL=y
CONFIG_FEATURE_FANCY_TAIL=y
# CONFIG_TEE is not set
# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
CONFIG_TRUE=y
CONFIG_TTY=y
CONFIG_UNAME=y
# CONFIG_UNEXPAND is not set
# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
# CONFIG_UNIQ is not set
CONFIG_USLEEP=y
# CONFIG_UUDECODE is not set
# CONFIG_UUENCODE is not set
CONFIG_WC=y
CONFIG_FEATURE_WC_LARGE=y
CONFIG_WHOAMI=y
# CONFIG_YES is not set

#
# Common options for cp and mv
#
# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set

#
# Common options for ls, more and telnet
#
CONFIG_FEATURE_AUTOWIDTH=y

#
# Common options for df, du, ls
#
CONFIG_FEATURE_HUMAN_READABLE=y

#
# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum
#
CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y

#
# Console Utilities
#
# CONFIG_CHVT is not set
CONFIG_FGCONSOLE=y
# CONFIG_CLEAR is not set
# CONFIG_DEALLOCVT is not set
# CONFIG_DUMPKMAP is not set
CONFIG_KBD_MODE=y
# CONFIG_LOADFONT is not set
# CONFIG_LOADKMAP is not set
# CONFIG_OPENVT is not set
# CONFIG_RESET is not set
CONFIG_RESIZE=y
CONFIG_FEATURE_RESIZE_PRINT=y
CONFIG_SETCONSOLE=y
CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y
CONFIG_SETFONT=y
CONFIG_FEATURE_SETFONT_TEXTUAL_MAP=y
CONFIG_DEFAULT_SETFONT_DIR=""
# CONFIG_SETKEYCODES is not set
CONFIG_SETLOGCONS=y
CONFIG_SHOWKEY=y

#
# Common options for loadfont and setfont
#
CONFIG_FEATURE_LOADFONT_PSF2=y
CONFIG_FEATURE_LOADFONT_RAW=y

#
# Debian Utilities
#
# CONFIG_MKTEMP is not set
# CONFIG_PIPE_PROGRESS is not set
# CONFIG_RUN_PARTS is not set
# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
# CONFIG_START_STOP_DAEMON is not set
# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set
# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set
# CONFIG_WHICH is not set

#
# Editors
#
# CONFIG_PATCH is not set
CONFIG_VI=y
CONFIG_FEATURE_VI_MAX_LEN=4096
# CONFIG_FEATURE_VI_8BIT is not set
CONFIG_FEATURE_VI_COLON=y
CONFIG_FEATURE_VI_YANKMARK=y
CONFIG_FEATURE_VI_SEARCH=y
# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
CONFIG_FEATURE_VI_USE_SIGNALS=y
CONFIG_FEATURE_VI_DOT_CMD=y
CONFIG_FEATURE_VI_READONLY=y
CONFIG_FEATURE_VI_SETOPTS=y
CONFIG_FEATURE_VI_SET=y
CONFIG_FEATURE_VI_WIN_RESIZE=y
CONFIG_FEATURE_VI_ASK_TERMINAL=y
CONFIG_AWK=y
CONFIG_FEATURE_AWK_LIBM=y
# CONFIG_CMP is not set
CONFIG_DIFF=y
CONFIG_FEATURE_DIFF_LONG_OPTIONS=y
CONFIG_FEATURE_DIFF_DIR=y
CONFIG_ED=y
CONFIG_SED=y
CONFIG_FEATURE_ALLOW_EXEC=y

#
# Finding Utilities
#
CONFIG_FIND=y
CONFIG_FEATURE_FIND_PRINT0=y
CONFIG_FEATURE_FIND_MTIME=y
CONFIG_FEATURE_FIND_MMIN=y
CONFIG_FEATURE_FIND_PERM=y
CONFIG_FEATURE_FIND_TYPE=y
CONFIG_FEATURE_FIND_XDEV=y
CONFIG_FEATURE_FIND_MAXDEPTH=y
CONFIG_FEATURE_FIND_NEWER=y
CONFIG_FEATURE_FIND_INUM=y
CONFIG_FEATURE_FIND_EXEC=y
CONFIG_FEATURE_FIND_USER=y
CONFIG_FEATURE_FIND_GROUP=y
CONFIG_FEATURE_FIND_NOT=y
CONFIG_FEATURE_FIND_DEPTH=y
CONFIG_FEATURE_FIND_PAREN=y
CONFIG_FEATURE_FIND_SIZE=y
CONFIG_FEATURE_FIND_PRUNE=y
CONFIG_FEATURE_FIND_DELETE=y
CONFIG_FEATURE_FIND_PATH=y
CONFIG_FEATURE_FIND_REGEX=y
# CONFIG_FEATURE_FIND_CONTEXT is not set
CONFIG_FEATURE_FIND_LINKS=y
CONFIG_GREP=y
CONFIG_FEATURE_GREP_EGREP_ALIAS=y
CONFIG_FEATURE_GREP_FGREP_ALIAS=y
CONFIG_FEATURE_GREP_CONTEXT=y
# CONFIG_XARGS is not set
# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set

#
# Init Utilities
#
CONFIG_BOOTCHARTD=y
CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER=y
CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE=y
CONFIG_HALT=y
# CONFIG_FEATURE_CALL_TELINIT is not set
CONFIG_TELINIT_PATH=""
CONFIG_INIT=y
CONFIG_FEATURE_USE_INITTAB=y
# CONFIG_FEATURE_KILL_REMOVED is not set
CONFIG_FEATURE_KILL_DELAY=0
CONFIG_FEATURE_INIT_SCTTY=y
CONFIG_FEATURE_INIT_SYSLOG=y
# CONFIG_FEATURE_EXTRA_QUIET is not set
# CONFIG_FEATURE_INIT_COREDUMPS is not set
CONFIG_FEATURE_INITRD=y
CONFIG_INIT_TERMINAL_TYPE="linux"
# CONFIG_MESG is not set
# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set

#
# Login/Password Management Utilities
#
# CONFIG_ADD_SHELL is not set
# CONFIG_REMOVE_SHELL is not set
CONFIG_FEATURE_SHADOWPASSWDS=y
CONFIG_USE_BB_PWD_GRP=y
CONFIG_USE_BB_SHADOW=y
CONFIG_USE_BB_CRYPT=y
CONFIG_USE_BB_CRYPT_SHA=y
# CONFIG_ADDUSER is not set
# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
# CONFIG_FEATURE_CHECK_NAMES is not set
CONFIG_FIRST_SYSTEM_ID=0
CONFIG_LAST_SYSTEM_ID=0
# CONFIG_ADDGROUP is not set
# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
# CONFIG_DELUSER is not set
# CONFIG_DELGROUP is not set
# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
# CONFIG_GETTY is not set
CONFIG_LOGIN=y
# CONFIG_LOGIN_SESSION_AS_CHILD is not set
# CONFIG_PAM is not set
# CONFIG_LOGIN_SCRIPTS is not set
# CONFIG_FEATURE_NOLOGIN is not set
# CONFIG_FEATURE_SECURETTY is not set
CONFIG_PASSWD=y
CONFIG_FEATURE_PASSWD_WEAK_CHECK=y
CONFIG_CRYPTPW=y
CONFIG_CHPASSWD=y
CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="des"
# CONFIG_SU is not set
# CONFIG_FEATURE_SU_SYSLOG is not set
# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
# CONFIG_SULOGIN is not set
# CONFIG_VLOCK is not set

#
# Linux Ext2 FS Progs
#
CONFIG_CHATTR=y
CONFIG_FSCK=y
CONFIG_LSATTR=y
# CONFIG_TUNE2FS is not set

#
# Linux Module Utilities
#
CONFIG_MODINFO=y
CONFIG_MODPROBE_SMALL=y
CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE=y
CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y
# CONFIG_INSMOD is not set
# CONFIG_RMMOD is not set
# CONFIG_LSMOD is not set
# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
# CONFIG_MODPROBE is not set
# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
# CONFIG_DEPMOD is not set

#
# Options common to multiple modutils
#
# CONFIG_FEATURE_2_4_MODULES is not set
# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
# CONFIG_FEATURE_MODUTILS_ALIAS is not set
# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set
CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"

#
# Linux System Utilities
#
CONFIG_BLOCKDEV=y
CONFIG_MDEV=y
CONFIG_FEATURE_MDEV_CONF=y
CONFIG_FEATURE_MDEV_RENAME=y
CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
CONFIG_FEATURE_MDEV_EXEC=y
CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
CONFIG_REV=y
CONFIG_ACPID=y
CONFIG_FEATURE_ACPID_COMPAT=y
CONFIG_BLKID=y
CONFIG_FEATURE_BLKID_TYPE=y
CONFIG_DMESG=y
CONFIG_FEATURE_DMESG_PRETTY=y
# CONFIG_FBSET is not set
# CONFIG_FEATURE_FBSET_FANCY is not set
# CONFIG_FEATURE_FBSET_READMODE is not set
# CONFIG_FDFLUSH is not set
# CONFIG_FDFORMAT is not set
CONFIG_FDISK=y
# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set
CONFIG_FEATURE_FDISK_WRITABLE=y
# CONFIG_FEATURE_AIX_LABEL is not set
# CONFIG_FEATURE_SGI_LABEL is not set
# CONFIG_FEATURE_SUN_LABEL is not set
# CONFIG_FEATURE_OSF_LABEL is not set
CONFIG_FEATURE_GPT_LABEL=y
CONFIG_FEATURE_FDISK_ADVANCED=y
CONFIG_FINDFS=y
CONFIG_FLOCK=y
# CONFIG_FREERAMDISK is not set
# CONFIG_FSCK_MINIX is not set
CONFIG_MKFS_EXT2=y
# CONFIG_MKFS_MINIX is not set
# CONFIG_FEATURE_MINIX2 is not set
# CONFIG_MKFS_REISER is not set
CONFIG_MKFS_VFAT=y
# CONFIG_GETOPT is not set
# CONFIG_FEATURE_GETOPT_LONG is not set
CONFIG_HEXDUMP=y
CONFIG_FEATURE_HEXDUMP_REVERSE=y
CONFIG_HD=y
# CONFIG_HWCLOCK is not set
# CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set
# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set
CONFIG_IPCRM=y
CONFIG_IPCS=y
# CONFIG_LOSETUP is not set
# CONFIG_LSPCI is not set
# CONFIG_LSUSB is not set
# CONFIG_MKSWAP is not set
# CONFIG_FEATURE_MKSWAP_UUID is not set
# CONFIG_MORE is not set
CONFIG_MOUNT=y
CONFIG_FEATURE_MOUNT_FAKE=y
CONFIG_FEATURE_MOUNT_VERBOSE=y
CONFIG_FEATURE_MOUNT_HELPERS=y
CONFIG_FEATURE_MOUNT_LABEL=y
# CONFIG_FEATURE_MOUNT_NFS is not set
# CONFIG_FEATURE_MOUNT_CIFS is not set
CONFIG_FEATURE_MOUNT_FLAGS=y
CONFIG_FEATURE_MOUNT_FSTAB=y
# CONFIG_PIVOT_ROOT is not set
# CONFIG_RDATE is not set
CONFIG_RDEV=y
CONFIG_READPROFILE=y
CONFIG_RTCWAKE=y
CONFIG_SCRIPT=y
CONFIG_SCRIPTREPLAY=y
# CONFIG_SETARCH is not set
# CONFIG_SWAPONOFF is not set
# CONFIG_FEATURE_SWAPON_PRI is not set
CONFIG_SWITCH_ROOT=y
CONFIG_UMOUNT=y
CONFIG_FEATURE_UMOUNT_ALL=y

#
# Common options for mount/umount
#
# CONFIG_FEATURE_MOUNT_LOOP is not set
# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set
# CONFIG_FEATURE_MTAB_SUPPORT is not set
CONFIG_VOLUMEID=y

#
# Filesystem/Volume identification
#
CONFIG_FEATURE_VOLUMEID_EXT=y
# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
# CONFIG_FEATURE_VOLUMEID_REISERFS is not set
CONFIG_FEATURE_VOLUMEID_FAT=y
CONFIG_FEATURE_VOLUMEID_EXFAT=y
CONFIG_FEATURE_VOLUMEID_HFS=y
# CONFIG_FEATURE_VOLUMEID_JFS is not set
# CONFIG_FEATURE_VOLUMEID_XFS is not set
# CONFIG_FEATURE_VOLUMEID_NILFS is not set
CONFIG_FEATURE_VOLUMEID_NTFS=y
# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set
# CONFIG_FEATURE_VOLUMEID_UDF is not set
# CONFIG_FEATURE_VOLUMEID_LUKS is not set
# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set
# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set
# CONFIG_FEATURE_VOLUMEID_ROMFS is not set
CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
# CONFIG_FEATURE_VOLUMEID_SYSV is not set
# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set
# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set

#
# Miscellaneous Utilities
#
CONFIG_CONSPY=y
CONFIG_LESS=y
CONFIG_FEATURE_LESS_MAXLINES=9999999
CONFIG_FEATURE_LESS_BRACKETS=y
CONFIG_FEATURE_LESS_FLAGS=y
CONFIG_FEATURE_LESS_MARKS=y
CONFIG_FEATURE_LESS_REGEXP=y
CONFIG_FEATURE_LESS_WINCH=y
CONFIG_FEATURE_LESS_ASK_TERMINAL=y
CONFIG_FEATURE_LESS_DASHCMD=y
CONFIG_FEATURE_LESS_LINENUMS=y
CONFIG_NANDWRITE=y
CONFIG_NANDDUMP=y
# CONFIG_SETSERIAL is not set
# CONFIG_UBIATTACH is not set
# CONFIG_UBIDETACH is not set
# CONFIG_UBIMKVOL is not set
# CONFIG_UBIRMVOL is not set
# CONFIG_UBIRSVOL is not set
# CONFIG_UBIUPDATEVOL is not set
# CONFIG_ADJTIMEX is not set
# CONFIG_BBCONFIG is not set
# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
# CONFIG_BEEP is not set
CONFIG_FEATURE_BEEP_FREQ=0
CONFIG_FEATURE_BEEP_LENGTH_MS=0
# CONFIG_CHAT is not set
# CONFIG_FEATURE_CHAT_NOFAIL is not set
# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set
# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set
# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set
# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
CONFIG_CHRT=y
# CONFIG_CROND is not set
# CONFIG_FEATURE_CROND_D is not set
# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
CONFIG_FEATURE_CROND_DIR=""
# CONFIG_CRONTAB is not set
# CONFIG_DC is not set
# CONFIG_FEATURE_DC_LIBM is not set
# CONFIG_DEVFSD is not set
# CONFIG_DEVFSD_MODLOAD is not set
# CONFIG_DEVFSD_FG_NP is not set
# CONFIG_DEVFSD_VERBOSE is not set
# CONFIG_FEATURE_DEVFS is not set
CONFIG_DEVMEM=y
# CONFIG_EJECT is not set
# CONFIG_FEATURE_EJECT_SCSI is not set
# CONFIG_FBSPLASH is not set
# CONFIG_FLASHCP is not set
# CONFIG_FLASH_LOCK is not set
# CONFIG_FLASH_UNLOCK is not set
# CONFIG_FLASH_ERASEALL is not set
CONFIG_IONICE=y
CONFIG_INOTIFYD=y
# CONFIG_LAST is not set
# CONFIG_FEATURE_LAST_SMALL is not set
# CONFIG_FEATURE_LAST_FANCY is not set
# CONFIG_HDPARM is not set
# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
# CONFIG_MAKEDEVS is not set
# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
CONFIG_MAN=y
# CONFIG_MICROCOM is not set
CONFIG_MOUNTPOINT=y
# CONFIG_MT is not set
# CONFIG_RAIDAUTORUN is not set
CONFIG_READAHEAD=y
# CONFIG_RFKILL is not set
CONFIG_RUNLEVEL=y
# CONFIG_RX is not set
CONFIG_SETSID=y
CONFIG_STRINGS=y
# CONFIG_TASKSET is not set
# CONFIG_FEATURE_TASKSET_FANCY is not set
# CONFIG_TIME is not set
CONFIG_TIMEOUT=y
CONFIG_TTYSIZE=y
# CONFIG_VOLNAME is not set
CONFIG_WALL=y
# CONFIG_WATCHDOG is not set

#
# Networking Utilities
#
# CONFIG_NAMEIF is not set
# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
CONFIG_NBDCLIENT=y
CONFIG_NC=y
CONFIG_NC_SERVER=y
CONFIG_NC_EXTRA=y
# CONFIG_NC_110_COMPAT is not set
CONFIG_PING=y
# CONFIG_PING6 is not set
CONFIG_FEATURE_FANCY_PING=y
CONFIG_WHOIS=y
# CONFIG_FEATURE_IPV6 is not set
# CONFIG_FEATURE_UNIX_LOCAL is not set
# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set
# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
CONFIG_ARP=y
CONFIG_ARPING=y
CONFIG_BRCTL=y
CONFIG_FEATURE_BRCTL_FANCY=y
CONFIG_FEATURE_BRCTL_SHOW=y
# CONFIG_DNSD is not set
CONFIG_ETHER_WAKE=y
# CONFIG_FAKEIDENTD is not set
# CONFIG_FTPD is not set
# CONFIG_FEATURE_FTP_WRITE is not set
# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
# CONFIG_FTPGET is not set
# CONFIG_FTPPUT is not set
# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
CONFIG_HOSTNAME=y
# CONFIG_HTTPD is not set
# CONFIG_FEATURE_HTTPD_RANGES is not set
# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set
# CONFIG_FEATURE_HTTPD_SETUID is not set
# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
# CONFIG_FEATURE_HTTPD_CGI is not set
# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
# CONFIG_FEATURE_HTTPD_PROXY is not set
# CONFIG_FEATURE_HTTPD_GZIP is not set
CONFIG_IFCONFIG=y
CONFIG_FEATURE_IFCONFIG_STATUS=y
# CONFIG_FEATURE_IFCONFIG_SLIP is not set
# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
CONFIG_FEATURE_IFCONFIG_HW=y
CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
CONFIG_IFENSLAVE=y
CONFIG_IFPLUGD=y
# CONFIG_IFUPDOWN is not set
CONFIG_IFUPDOWN_IFSTATE_PATH=""
# CONFIG_FEATURE_IFUPDOWN_IP is not set
# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set
# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set
# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set
# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set
# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set
# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
# CONFIG_INETD is not set
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
# CONFIG_FEATURE_INETD_RPC is not set
# CONFIG_IP is not set
# CONFIG_FEATURE_IP_ADDRESS is not set
# CONFIG_FEATURE_IP_LINK is not set
# CONFIG_FEATURE_IP_ROUTE is not set
# CONFIG_FEATURE_IP_TUNNEL is not set
# CONFIG_FEATURE_IP_RULE is not set
# CONFIG_FEATURE_IP_SHORT_FORMS is not set
# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
# CONFIG_IPADDR is not set
# CONFIG_IPLINK is not set
# CONFIG_IPROUTE is not set
# CONFIG_IPTUNNEL is not set
# CONFIG_IPRULE is not set
# CONFIG_IPCALC is not set
# CONFIG_FEATURE_IPCALC_FANCY is not set
# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
CONFIG_NETSTAT=y
CONFIG_FEATURE_NETSTAT_WIDE=y
CONFIG_FEATURE_NETSTAT_PRG=y
CONFIG_NSLOOKUP=y
CONFIG_NTPD=y
CONFIG_FEATURE_NTPD_SERVER=y
CONFIG_PSCAN=y
CONFIG_ROUTE=y
CONFIG_SLATTACH=y
CONFIG_TCPSVD=y
# CONFIG_TELNET is not set
# CONFIG_FEATURE_TELNET_TTYPE is not set
# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set
CONFIG_TELNETD=y
CONFIG_FEATURE_TELNETD_STANDALONE=y
CONFIG_FEATURE_TELNETD_INETD_WAIT=y
# CONFIG_TFTP is not set
# CONFIG_TFTPD is not set
# CONFIG_FEATURE_TFTP_GET is not set
# CONFIG_FEATURE_TFTP_PUT is not set
# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
# CONFIG_TFTP_DEBUG is not set
CONFIG_TRACEROUTE=y
# CONFIG_TRACEROUTE6 is not set
CONFIG_FEATURE_TRACEROUTE_VERBOSE=y
# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
CONFIG_TUNCTL=y
CONFIG_FEATURE_TUNCTL_UG=y
# CONFIG_UDHCPC6 is not set
CONFIG_UDHCPD=y
CONFIG_DHCPRELAY=y
CONFIG_DUMPLEASES=y
CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY=y
# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
CONFIG_DHCPD_LEASES_FILE="/tmp/udhcpd.leases"
CONFIG_UDHCPC=y
CONFIG_FEATURE_UDHCPC_ARPING=y
# CONFIG_FEATURE_UDHCP_PORT is not set
CONFIG_UDHCP_DEBUG=9
CONFIG_FEATURE_UDHCP_RFC3397=y
CONFIG_FEATURE_UDHCP_8021Q=y
CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS=""
CONFIG_UDPSVD=y
CONFIG_VCONFIG=y
CONFIG_WGET=y
CONFIG_FEATURE_WGET_STATUSBAR=y
CONFIG_FEATURE_WGET_AUTHENTICATION=y
CONFIG_FEATURE_WGET_LONG_OPTIONS=y
CONFIG_FEATURE_WGET_TIMEOUT=y
CONFIG_ZCIP=y

#
# Print Utilities
#
# CONFIG_LPD is not set
# CONFIG_LPR is not set
# CONFIG_LPQ is not set

#
# Mail Utilities
#
# CONFIG_MAKEMIME is not set
CONFIG_FEATURE_MIME_CHARSET=""
# CONFIG_POPMAILDIR is not set
# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
# CONFIG_REFORMIME is not set
# CONFIG_FEATURE_REFORMIME_COMPAT is not set
# CONFIG_SENDMAIL is not set

#
# Process Utilities
#
CONFIG_IOSTAT=y
CONFIG_LSOF=y
CONFIG_MPSTAT=y
CONFIG_NMETER=y
CONFIG_PMAP=y
CONFIG_POWERTOP=y
CONFIG_PSTREE=y
CONFIG_PWDX=y
CONFIG_SMEMCAP=y
CONFIG_TOP=y
CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
CONFIG_FEATURE_TOP_SMP_CPU=y
CONFIG_FEATURE_TOP_DECIMALS=y
CONFIG_FEATURE_TOP_SMP_PROCESS=y
CONFIG_FEATURE_TOPMEM=y
CONFIG_UPTIME=y
# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
CONFIG_FREE=y
CONFIG_FUSER=y
CONFIG_KILL=y
CONFIG_KILLALL=y
CONFIG_KILLALL5=y
CONFIG_PGREP=y
CONFIG_PIDOF=y
CONFIG_FEATURE_PIDOF_SINGLE=y
CONFIG_FEATURE_PIDOF_OMIT=y
CONFIG_PKILL=y
CONFIG_PS=y
CONFIG_FEATURE_PS_WIDE=y
CONFIG_FEATURE_PS_LONG=y
# CONFIG_FEATURE_PS_TIME is not set
# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
CONFIG_RENICE=y
CONFIG_BB_SYSCTL=y
CONFIG_FEATURE_SHOW_THREADS=y
# CONFIG_WATCH is not set

#
# Runit Utilities
#
CONFIG_RUNSV=y
CONFIG_RUNSVDIR=y
# CONFIG_FEATURE_RUNSVDIR_LOG is not set
CONFIG_SV=y
CONFIG_SV_DEFAULT_SERVICE_DIR="/var/service"
CONFIG_SVLOGD=y
CONFIG_CHPST=y
CONFIG_SETUIDGID=y
CONFIG_ENVUIDGID=y
CONFIG_ENVDIR=y
CONFIG_SOFTLIMIT=y
# CONFIG_CHCON is not set
# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
# CONFIG_GETENFORCE is not set
# CONFIG_GETSEBOOL is not set
# CONFIG_LOAD_POLICY is not set
# CONFIG_MATCHPATHCON is not set
# CONFIG_RESTORECON is not set
# CONFIG_RUNCON is not set
# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
# CONFIG_SELINUXENABLED is not set
# CONFIG_SETENFORCE is not set
# CONFIG_SETFILES is not set
# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
# CONFIG_SETSEBOOL is not set
# CONFIG_SESTATUS is not set

#
# Shells
#
CONFIG_ASH=y
CONFIG_ASH_BASH_COMPAT=y
# CONFIG_ASH_IDLE_TIMEOUT is not set
# CONFIG_ASH_JOB_CONTROL is not set
CONFIG_ASH_ALIAS=y
# CONFIG_ASH_GETOPTS is not set
CONFIG_ASH_BUILTIN_ECHO=y
CONFIG_ASH_BUILTIN_PRINTF=y
CONFIG_ASH_BUILTIN_TEST=y
# CONFIG_ASH_CMDCMD is not set
# CONFIG_ASH_MAIL is not set
# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set
# CONFIG_ASH_RANDOM_SUPPORT is not set
# CONFIG_ASH_EXPAND_PRMT is not set
CONFIG_CTTYHACK=y
# CONFIG_HUSH is not set
# CONFIG_HUSH_BASH_COMPAT is not set
# CONFIG_HUSH_BRACE_EXPANSION is not set
# CONFIG_HUSH_HELP is not set
# CONFIG_HUSH_INTERACTIVE is not set
# CONFIG_HUSH_SAVEHISTORY is not set
# CONFIG_HUSH_JOB is not set
# CONFIG_HUSH_TICK is not set
# CONFIG_HUSH_IF is not set
# CONFIG_HUSH_LOOPS is not set
# CONFIG_HUSH_CASE is not set
# CONFIG_HUSH_FUNCTIONS is not set
# CONFIG_HUSH_LOCAL is not set
# CONFIG_HUSH_RANDOM_SUPPORT is not set
# CONFIG_HUSH_EXPORT_N is not set
# CONFIG_HUSH_MODE_X is not set
# CONFIG_MSH is not set
CONFIG_FEATURE_SH_IS_ASH=y
# CONFIG_FEATURE_SH_IS_HUSH is not set
# CONFIG_FEATURE_SH_IS_NONE is not set
# CONFIG_FEATURE_BASH_IS_ASH is not set
# CONFIG_FEATURE_BASH_IS_HUSH is not set
CONFIG_FEATURE_BASH_IS_NONE=y
CONFIG_SH_MATH_SUPPORT=y
CONFIG_SH_MATH_SUPPORT_64=y
# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
# CONFIG_FEATURE_SH_STANDALONE is not set
# CONFIG_FEATURE_SH_NOFORK is not set
CONFIG_FEATURE_SH_HISTFILESIZE=y

#
# System Logging Utilities
#
CONFIG_SYSLOGD=y
CONFIG_FEATURE_ROTATE_LOGFILE=y
CONFIG_FEATURE_REMOTE_LOG=y
CONFIG_FEATURE_SYSLOGD_DUP=y
CONFIG_FEATURE_SYSLOGD_CFG=y
CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256
CONFIG_FEATURE_IPC_SYSLOG=y
CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
CONFIG_LOGREAD=y
# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
CONFIG_FEATURE_KMSG_SYSLOG=y
CONFIG_KLOGD=y

#
# klogd should not be used together with syslog to kernel printk buffer
#
CONFIG_FEATURE_KLOGD_KLOGCTL=y
CONFIG_LOGGER=y

dropbear.sh

#!/bin/sh

do_start()
{
	[[ "$(param get dropbear_enable)" = "1" ]] || exit 1
	param set dropbear_state=0
	nice -15 /sbin/dropbear -r /etc/dropbear_rsa_host_key && param set dropbear_state=1
}

do_stop()
{
	killall dropbear
	param set dropbear_state=0
}

do_fwopen()
{
	[[ "$(param get dropbear_fwopen)" = "1" ]] || exit 1
	#open external firewall range 9, (ex ftp) , port 22
	/bin/nat5 agApi_setDeviceListenPortRange 9 22 22 0
}

do_fwclose()
{
	[[ "$(param get dropbear_fwopen)" = "0" ]] || exit 1
	#close external firewall range 9, (ex ftp) to default
	/bin/nat5 agApi_setDeviceListenPortRange 9 21 20 0
}

case "$1" in
  start)
        do_start
	do_fwopen
        ;;
  stop)
        do_stop
	do_fwclose
        ;;
  fwopen)
        do_fwopen
        ;;
  fwclose)
        do_fwclose
        ;;
esac

dynamicdns.sh

#!/bin/sh

i=$(param get inadyn_value)
eval $(echo "$i" | sed "s#--#\n#g" | grep " ." | sed "s/ /=/")


echo "
<html><head>
<style type='text/css'>
.prgbar { font-family:Arial; padding:0px; height: 20px; width: 200px; font-weight: bolder; font-size: 10pt; color: #0000FF}
</style>
<script type='text/javascript'>
onload=function(){
	//set current values
	e = document.getElementById('dyndns_system')
	for (j = 0; j < e.length; j++) {
		if (e.options[j].value == '${dyndns_system}') {e.selectedIndex = j}
	}
}

function update(){
	//update string on change
	var s=''
	all = document.getElementsByTagName('*');
	for (i = 0; i < all.length; i++) {
		if (all[i].nodeName == 'SELECT' || all[i].nodeName == 'INPUT') {
			id=all[i].getAttribute('id')
			if (id !== null) {
				e=document.getElementById(id)
				if (e.value !== '') {
					s=s+'--'+id+' '+e.value.trim()+' '
				}
			}
		}
	}
	document.getElementById('dlna').media_server_name.value=s
}

function go(){
	//submit changes
	d=document.getElementById('dlna')
	if (document.getElementById('dyndns_system').value == ''){
		d.media_server_name.value=''
	}
	else 
	{
		update()
		d.media_server_name.value='inadynset#'+d.media_server_name.value
	}
	d.submit()
	tick()
	setTimeout(function(){location.reload(true)},5000)
}

function tick()
{
	document.getElementById('body').innerHTML='<center><h1><%301%></h1><form name=tik><input type=text name=tick class=prgbar></form>'
	setInterval('document.forms[\'tik\'].tick.value += \'|\'',100)
}

</script>
<link rel=stylesheet href=form.css></head>
<body>

<iframe name=ifr style='visibility:hidden;display:none' height=0 width=0></iframe>

<DIV id=body>

<table border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr>
	<td colspan=2><h1>Dynamic DNS</h1></td>
</tr>

<tr>
	<td colspan=2 background=liteblue.gif height=12>&nbsp; </td>
</tr>

<tr>
	<td width=150>DynDNS Service</td>
	<td>
		<select id=dyndns_system style='width:155px'>
		<option value=>Disabled</option>
		<option value=dyndns@dyndns.org>dyndns.org</option>
		<option value=default@freedns.afraid.org>freedns.afraid.org</option>
		<option value=default@zoneedit.com>zoneedit.com</option>
		<option value=default@no-ip.com>no-ip.com</option>
		<option value=default@easydns.com>easydns.com</option>
		<option value=dyndns@3322.org>3322.org</option>
		<option value=default@sitelutions.com>sitelutions.com</option>
		<option value=default@dnsomatic.com>dnsomatic.com</option>
		<option value=ipv6tb@he.net>tunnelbroker.net</option>
		<option value=default@tzo.com>tzo.com</option>
		<option value=default@dynsip.org>dynsip.org</option>
		<option value=default@dhis.org>dhis.org</option>
		<option value=default@majimoto.net>majimoto.net</option>
		<option value=default@zerigo.com>zerigo.com</option>
		<option value=custom@http_svr_basic_auth>generic</option>
		</select>
	</td>
</tr>

<tr><td width=150>Username (or hash)</td><td><input id=username value='${username}' type=text></td></tr>
<tr><td width=150>Password</td><td><input id=password value='${password}' type=text></td></tr>
<tr><td width=150>Alias Hostname</td><td><input id=alias value='${alias}' type=text></td></tr>

<tr>
<td colspan=2><br>
<input size=150 type=button value='Show/Hide Advanced' onclick=\"document.getElementById('n').style.display=(document.getElementById('n').style.display=='block')?'none':'block';return false;\"><br>
	<div id=n style='display:none;'><br>
	&nbsp;&nbsp;&nbsp;<span class=thead>Advanced Options</span><br>
		<table border='0' cellpadding='0' cellspacing='3' width='100%'>
			<tr><td width=150>IP server name</td><td><input id=ip_server_name value='${ip_server_name}' type=text></td></tr>
			<tr><td width=150>Online check URL</td><td><input id=online_check_url value='${online_check_url}' type=text></td></tr>
			<tr><td width=150>DynDNS server name</td><td><input id=dyndns_server_name value='${dyndns_server_name}' type=text></td></tr>
			<tr><td width=150>DynDNS server URL</td><td><input id=dyndns_server_url value='${dyndns_server_url}' type=text></td></tr>
			<tr><td width=150>Proxy server</td><td><input id=proxy_server value='${proxy_server}' type=text></td></tr>
			<tr><td width=150>Update period (ms)</td><td><input id=update_period value='${update_period}' type=text></td></tr>
			<tr><td width=150>Update period (s)</td><td><input id=update_period_sec value='${update_period_sec}' type=text></td></tr>
			<tr><td width=150>Forced update period (s)</td><td><input id=forced_update_period value='${forced_update_period}' type=text></td></tr>
			<tr><td width=150>Iterations</td><td><input id=iterations value='${iterations}' type=text></td></tr>
			<tr><td width=150>Wildcard</td><td><input id=wildcard value='${wildcard}' type=text></td></tr>
			<tr><td width=150>Retries</td><td><input id=retries value='${retries}' type=text></td></tr>
			<tr><td width=150>Retry interval (ms)</td><td><input id=retry_interval value='${retry_interval}' type=text></td></tr>
			<tr><td width=150>Retry pending interval (s)</td><td><input id=retry_pending_interval value='${retry_pending_interval}' type=text></td></tr>
		</table>
	</div>
</td>
</tr>


<tr>
	<td colspan=2><br>
		<form id=dlna method=POST action=dlna.cgi target=ifr>
		<input type=hidden name=enable_ms value=1>
		<input type=hidden name=ms_active_status value=1>
		<input type=hidden name=media_server_name>
		<input type=button value=Apply onClick=go()>
		</form><br>
	</td>
</tr>



<tr>
	<td colspan=2 background=liteblue.gif height=12>&nbsp; </td>
</tr>

<tr>
	<td colspan=2><h1>System Log</h1></td>
</tr>

<tr>
	<td colspan=2>
		<input type=button value='Show/Hide Syslog' onclick=\"document.getElementById('sys').style.display=(document.getElementById('sys').style.display=='block')?'none':'block';return false;\"><br>
		<div id=sys style='display:none;'><br>
		&nbsp;&nbsp;&nbsp;<span class=thead>/var/log/messages</span><br>
		<object style='width:100%; height:250px;' data='messages'></object>
		</div>
	</td>
</tr>

<tr>
	<td colspan=2 background=liteblue.gif height=12>&nbsp; </td>
</tr>

</table>
</DIV>
</BODY>
</html>
" > /www/dynamicdns.htm

mdev.conf

#
# This is a sample mdev.conf
#

# Provide user, group, and mode information for devices.  If a regex matches
# the device name provided by sysfs, use the appropriate user:group and mode
# instead of the default 0:0 660.
#
# Syntax:
# [-]devicename_regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]$ENVVAR=regex    user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]@maj,min[-min2]  user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
#
# [-]: do not stop on this match, continue reading mdev.conf
# =: move, >: move and create a symlink
# !: do not create device node
# @|$|*: run@cmd if $ACTION=add,  $cmd if $ACTION=remove, *cmd in all cases

sd[a-z].*	0:6 660 */etc/automount.sh

mdlna.Makefile

MDLNA_LIBZ = zlib-1.2.7
MDLNA_FFMPEG = ffmpeg-1.1.3
MDLNA_LIBOGG = libogg-1.3.0
MDLNA_LIBEXIF = libexif-0.6.21
MDLNA_LIBFLAC = flac-1.2.1
MDLNA_LIBVORBIS = libvorbis-1.3.3
MDLNA_LIBJPEG = jpeg-9
MDLNA_LIBSQLITE3 = sqlite-autoconf-3071502
MDLNA_LIBID3TAG = libid3tag-0.15.1b
MDLNA_MINIDLNA = minidlna-1.1.0

SUBDIRS += $(MDLNA_LIBZ)
SUBDIRS += $(MDLNA_FFMPEG)
SUBDIRS += $(MDLNA_LIBOGG)
SUBDIRS += $(MDLNA_LIBEXIF)
SUBDIRS += $(MDLNA_LIBFLAC)
SUBDIRS += $(MDLNA_LIBVORBIS)
SUBDIRS += $(MDLNA_LIBJPEG)
SUBDIRS += $(MDLNA_LIBSQLITE3)
SUBDIRS += $(MDLNA_LIBID3TAG)
SUBDIRS += $(MDLNA_MINIDLNA)

HOST=mips-linux
MDLNA_PATH = $(shell pwd)
ALL = libz ffmpeg libogg libexif libflac libvorbis libjpeg libsqlite3 libid3tag minidlna

all: $(ALL)

libz:
	cd $(MDLNA_LIBZ); \
	./configure ; \
	make -j4

libsqlite3:
	cd $(MDLNA_LIBSQLITE3); \
	./configure --host=$(HOST); \
	make -j4

libexif:
	cd $(MDLNA_LIBEXIF); \
	./configure --host=$(HOST); \
	make -j4

libid3tag:
	cd $(MDLNA_LIBID3TAG); \
	LDFLAGS="-L$(MDLNA_PATH)/$(MDLNA_LIBZ) -lz" CPPFLAGS="-I$(MDLNA_PATH)/$(MDLNA_LIBZ)" ./configure --host=$(HOST); \
	make -j4

libjpeg:
	cd $(MDLNA_LIBJPEG); \
	./configure --host=$(HOST); \
	make -j4

libogg:
	cd $(MDLNA_LIBOGG); \
	./configure --host=$(HOST); \
	make -j4

libvorbis:
	cd $(MDLNA_LIBVORBIS); \
	CFLAGS="$(CFLAGS) -I$(MDLNA_PATH)/$(MDLNA_LIBOGG)/include" LDFLAGS="-L$(MDLNA_PATH)/$(MDLNA_LIBOGG)/src/.libs -logg" ./configure --host=$(HOST); \
	make -j4

libflac:
	cd $(MDLNA_LIBFLAC); \
	CFLAGS="$(CFLAGS) -I$(MDLNA_PATH)/$(MDLNA_LIBOGG)/include" LDFLAGS="-L$(MDLNA_PATH)/$(MDLNA_LIBOGG)/src/.libs -logg" ./configure --host=$(HOST); \
	make -j4

ffmpeg:
	cd $(MDLNA_FFMPEG); \
	LDFLAGS="-L$(MDLNA_PATH)/$(MDLNA_LIBZ) -lz" CPPFLAGS="-I$(MDLNA_PATH)/$(MDLNA_LIBZ)" ./configure --cross-prefix=$(CROSS_COMPILE) --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --arch=mips --target-os=linux --enable-cross-compile --enable-shared --disable-programs --disable-doc --disable-encoders --disable-muxers --disable-filters --disable-swscale --disable-swresample --disable-avfilter --enable-zlib; \
	make -j4

minidlna:
	cd $(MDLNA_MINIDLNA); \
	CFLAGS="$(CFLAGS) \
	-I$(MDLNA_PATH)/$(MDLNA_LIBZ) \
	-I$(MDLNA_PATH)/$(MDLNA_LIBOGG)/include \
	-I$(MDLNA_PATH)/$(MDLNA_FFMPEG) \
	-I$(MDLNA_PATH)/$(MDLNA_LIBSQLITE3) \
	-I$(MDLNA_PATH)/$(MDLNA_LIBEXIF) \
	-I$(MDLNA_PATH)/$(MDLNA_LIBID3TAG) \
	-I$(MDLNA_PATH)/$(MDLNA_LIBOGG)/include \
	-I$(MDLNA_PATH)/$(MDLNA_LIBVORBIS)/include \
	-I$(MDLNA_PATH)/$(MDLNA_LIBJPEG) \
	-I$(MDLNA_PATH)/$(MDLNA_LIBFLAC)/include" \
	LDFLAGS="-L$(MDLNA_PATH)/$(MDLNA_LIBZ) -lz \
	-L$(MDLNA_PATH)/$(MDLNA_LIBOGG)/src/.libs -logg \
	-L$(MDLNA_PATH)/$(MDLNA_FFMPEG)/libavutil -lavutil \
	-L$(MDLNA_PATH)/$(MDLNA_FFMPEG)/libavcodec -lavcodec \
	-L$(MDLNA_PATH)/$(MDLNA_FFMPEG)/libavformat -lavformat \
	-L$(MDLNA_PATH)/$(MDLNA_LIBSQLITE3)/.libs -lsqlite3 \
	-L$(MDLNA_PATH)/$(MDLNA_LIBEXIF)/libexif/.libs -lexif \
	-L$(MDLNA_PATH)/$(MDLNA_LIBID3TAG)/.libs -lid3tag \
	-L$(MDLNA_PATH)/$(MDLNA_LIBVORBIS)/lib/.libs -lvorbis \
	-L$(MDLNA_PATH)/$(MDLNA_LIBJPEG)/.libs -ljpeg \
	-L$(MDLNA_PATH)/$(MDLNA_LIBFLAC)/src/libFLAC/.libs -lFLAC" \
	./configure --host=$(HOST) --enable-netgear; \
	make -j4

install:
	echo Installing miniDLNA and libraries
	find $(MDLNA_PATH) -type f -name "*.so*" -o -name "minidlnad" -exec $(STRIP) {} \;
	for i in $(ALL) libav; do find $(TARGETDIR)/lib -type f -iname "$$i*" -exec rm -f {} \; ; done 
	rm -f $(TARGETDIR)/usr/sbin/minidlna.exe
	find $(MDLNA_PATH) -name "*.so*" -not -iname "libvorbis[a-z]*.so*" -exec cp -a {} "$(TARGETDIR)/lib" \;
	find $(MDLNA_PATH) -type f -name "minidlnad" -exec cp -a {} "$(TARGETDIR)/usr/sbin/minidlnad" \;

minidlna.sh

#!/bin/sh

media_dir=/media

do_sanity()
{
	[[ "$(param get minidlna_enable)" = "1" ]] || exit 1
	param set minidlna_state=0
}

do_config()
{
	#can only have one db dir so abitarily pick first one in media_dir
	echo "\
		port=8200
		media_dir=${media_dir}
		friendly_name=ReadyDLNA:DGND3700
		db_dir=${media_dir}/$(ls ${media_dir} | head -1)/.ReadyDLNA
		album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
		inotify=yes
		enable_tivo=no
		strict_dlna=no
		presentation_url=http://www.routerlogin.com
		notify_interval=900
		serial=12345678
		model_number=1
	" > /etc/minidlna.conf
}

do_restart()
{
	pidof minidlnad && { killall -HUP minidlnad && param set minidlna_state=1; } || do_start
}

do_start()
{
	[[ "$(ls ${media_dir})" ]] || exit 1
	#doesnt work unless in debug mode, very odd, original firmware same
	nohup nice -n 16 /usr/sbin/minidlnad -d -f /etc/minidlna.conf >/dev/null &
	sleep 2
	pgrep -f /usr/sbin/minidlnad && param set minidlna_state=1
}

do_stop()
{
	/bin/sync
	killall minidlnad
	sleep 2
	killall -9 minidlnad
	param set minidlna_state=0
}


case "$1" in
  start)
	do_sanity
	do_config
        do_start
        ;;
  stop)
        do_stop
        ;;
  restart)
	do_sanity
	do_config
        do_restart
        ;;
esac

nfsd.sh

#!/bin/sh

media_dir=/media

do_sanity()
{
	[[ "$(param get nfsd_enable)" = "1" ]] || exit 1
	param set nfsd_state=0
}

do_config()
{
	echo "${media_dir} $(param get lan_ipaddr)/16(rw,crossmnt,all_squash,async,no_subtree_check,insecure,fsid=0,anonuid=0,anongid=0)" > /etc/exports
	ls ${media_dir} | while read i
		do
			echo "\"${media_dir}/${i}\" $(param get lan_ipaddr)/16(rw,all_squash,async,no_subtree_check,insecure,anonuid=0,anongid=0)" >> /etc/exports
		done
}

do_restart(){
	pidof nfsd && { /sbin/exportfs -ar && param set nfsd_state=1; } || do_start
}


do_start()
{
	[[ "$(ls ${media_dir})" ]] || exit 1
	#sequence given in README in nfs-utils
	nice -n 17 /sbin/portmap
	touch /etc/idmapd.conf
	mkdir -p /var/lib/nfs/rpc_pipefs /var/lib/nfs/v4recovery
	mount -t rpc_pipefs rpc_pipfs /var/lib/nfs/rpc_pipefs
	mount -t nfsd nfsd /proc/fs/nfsd
	nice -n 17 /sbin/idmapd
	/sbin/exportfs -ar
	nice -n 17 /sbin/mountd
	nice -n 17 /sbin/statd --no-notify
	nice -n 17 /sbin/nfsd 4 && param set nfsd_state=1
	nice -n 17 /sbin/sm-notify
}

do_stop()
{
	/bin/sync
	killall statd nfsd mountd portmap lockd idmapd
	sleep 2
	killall -9 statd nfsd mountd portmap lockd idmapd
	umount /proc/fs/nfsd
	umount /var/lib/nfs/rpc_pipefs
	param set nfsd_state=0
}


case "$1" in
  start)
	do_sanity
	do_config
        do_start
        ;;
  stop)
        do_stop
        ;;
  restart)
	do_sanity
	do_config
        do_restart
        ;;
esac

rcS

#! /bin/sh

export PATH=/bin:/sbin:/usr/bin:/usr/sbin
export LD_LIBRARY_PATH=/lib:/lib/public:/lib/private:/lib/gpl
KERNELVER=2.6.21.5

#mount virtual filesystems
mount -t proc proc /proc
mount -t sysfs sysfs /sys

mount -t tmpfs tmpfs /tmp
mount -t tmpfs tmpfs /media
mount -t tmpfs tmpfs /dev

#syslog daemon
/sbin/syslogd


#mdev populate initial /dev and /sys
touch /dev/mdev.seq /dev/mdev.log
echo > /proc/sys/kernel/hotplug
/sbin/mdev -s

#replicate original /dev 
mknod /dev/initctl p
mknod /dev/ubi0 c 254 0
mknod /dev/ubi_ctrl c 10 63
mknod /dev/acos_nat_cli c 100 0
mknod /dev/aglog c 123 0
mknod /dev/gpio_drv c 124 0
mknod /dev/ram0 b 1 0
mknod /dev/ram1 b 1 1
mknod /dev/ram2 b 1 2
mknod /dev/ram3 b 1 3
mknod /dev/bcmatm0 c 205 0
mknod /dev/brcmboard c 206 0
mknod /dev/bcmvdsl0 c 207 0
mknod /dev/bcmadsl0 c 208 0
mknod /dev/bcmadsl1 c 208 1
mknod /dev/bcmendpoint0 c 209 0
mknod /dev/bcmaal20 c 210 0
mknod /dev/bcmles0 c 211 0
mknod /dev/bcm c 212 0
mknod /dev/bounce c 213 0
mknod /dev/pmon c 214 0
mknod /dev/ac97 c 222 0
mknod /dev/slac c 223 0
mknod /dev/bcmprof c 224 0
mknod /dev/si3215 c 225 0
mknod /dev/bcmatmb0 c 226 0
mknod /dev/p8021ag0 c 227 0
mknod /dev/bcmxtmcfg0 c 228 0
mknod /dev/bcmgpon_bar3 c 229 0
mknod /dev/bcmgpon_ploam c 230 0
mknod /dev/bcmgpon c 231 0
mknod /dev/pktcmf c 232 0
mknod /dev/spu c 233 0
mknod /dev/bcmmoca0 c 234 0
mknod /dev/bcm_user_ploam c 235 0
mknod /dev/bcm_omci c 236 0
mknod /dev/bcm_ploam c 237 0
mknod /dev/bcmvlan c 238 0
mknod /dev/pwrmngt c 240 0
mknod /dev/bcmfap c 241 0
mknod /dev/fcache c 242 0
mknod /dev/hwrandom c 10 183
mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/ptmx c 5 2
ln -s /dev/ram1 /dev/ram

#broadcom/neatgear startup
mkdir -p /tmp/var /var/log /var/run /var/state/dhcp /var/ppp /var/udhcpd /var/zebra /var/siproxd /var/cache /var/tmp
ifconfig lo 127.0.0.1 netmask 255.0.0.0 broadcast 127.255.255.255 up

#incase anything checks mtab
touch /etc/mtab

#std hosts file, inadyn segfaults without a hosts file
echo -e "127.0.0.1	localhost.localdomain	localhost\n127.0.1.1       DGND3700" > /etc/hosts

#kernel modules with fuse added from default
for i in bcmprocfs.ko pktflow.ko pktcmf.ko bcmxtmcfg.ko adsldd.ko bcm_enet.ko wl.ko multissidcontrol.ko p8021ag.ko acos_nat.ko fuse.ko
do
	insmod /lib/modules/$KERNELVER/extra/$i
done


#original broadcom/neatgear bits
cmf learn --disable
param init

#make sure everything has initial state stopped if saved in nvram as started
for i in telnetd dropbear nfsd samba transmission automatic minidlna
do
	param set ${i}_state=0
done

#stop deprecated versions, hardcoded in acos, probably doesnt make any difference
for i in dlna smb usb_ftp usb_wan_ftp
do
	param set ${i}_enable=0
done

#broadcom/neatgear bits, startup acos_service tries to kill all original service processes no matter settings
acos_init
acos_service start

#ADSL Advanced setting
[[ "$(param get adsl_value)" = "" ]] || /bin/adslctl configure $(param get adsl_value)

#fixup any reserved ips, busybox no longer uses udhcpd_resrv.conf
if [ "$(param get dhcp_mode)" = "manual" ]
then
	killall udhcpd
	ips=$(param get dhcp_resrv_ip)
	macs=$(param get dhcp_resrv_mac)
	for i in $ips
	do 
		ip=${ips%% *} ; mac=${macs%% *}
		ips=${ips/$ip /} ; macs=${macs/$mac /}
		echo "static_lease $mac $ip" >> /tmp/udhcpd.conf
	done
	nice -10 /usr/sbin/udhcpd -S /tmp/udhcpd.conf
fi

#fix /etc/passwords, netgears httpd generates one with windows carriage returns and breaks things
echo "\
root:*:0:0:root:/:/bin/sh
nobody:*:0:0:nobody:/:/bin/sh
admin:$(param get http_passwd):0:0:admin:/:/bin/sh
guest:guest:0:0:guest:/:/bin/sh
" >> /etc/passwd
echo admin:$(mkpasswd $(param get http_passwd)):0:0::::: > /etc/shadow

#wait for networking to come up fully
sleep 10

#start telnet and SSH
/etc/init.d/telnetd.sh start
/etc/init.d/dropbear.sh start

#start hotplug to mount drives and trigger other services start, needs to be after acos_service
echo /sbin/mdev > /proc/sys/kernel/hotplug
/sbin/mdev -s

#inotify using deprecated minidlna config cgi to pass new web interface options
touch /tmp/minidlna.conf
/sbin/inotifyd /etc/watch.sh /tmp/minidlna.conf:c &

#inadyn-mt DDNS service
[[ "$(param get inadyn_value)" = "" ]] || nice -19 /bin/inadyn-mt --background $(param get inadyn_value)

#generate web status pages after everything finished
sleep 5
/etc/adsl.sh
/etc/services.sh
/etc/dynamicdns.sh
/etc/torrent.sh

samba.sh

#!/bin/sh

media_dir=/media

do_sanity()
{
	[[ "$(param get samba_enable)" = "1" ]] || exit 1
	param set samba_state=0
}

do_config()
{
	echo "\
	[global]
	security = share
	guest account = nobody
	printable = no
	workgroup = Workgroup
	netbios name = readyshare
	server string = readyshare
	interfaces = $(param get lan_ipaddr)/$(param get lan_netmask)
	load printers = no
	printing = bsd
	printcap name = /dev/null
	show add printer wizard = no
	disable spoolss = yes
	state directory = /var
	cache directory = /var
	pid directory = /var/run
	private dir = /var\
	" > /etc/smb.conf

	ls ${media_dir} | while read i
		do
			echo "\
			[${i}]
			comment = USB Share ${media_dir}/${i} on DGND3700
			path = ${media_dir}/${i}
			browseable = yes
			writeable = yes
			guest ok = yes\
			" >> /etc/smb.conf
		done
}

do_restart()
{
	pidof smbd && { killall -HUP smbd && param set samba_state=1; } || do_start
}


do_start()
{
	[[ "$(ls ${media_dir})" ]] || exit 1
	nice -n 17 /sbin/nmbd -s /etc/smb.conf -D
	nice -n 17 /sbin/smbd -s /etc/smb.conf -D && param set samba_state=1
}

do_stop()
{
	/bin/sync
	killall smbd nmbd
	sleep 2
	killall -9 smbd nmbd
	param set samba_state=0
}


case "$1" in
  start)
	do_sanity
	do_config
        do_start
        ;;
  stop)
        do_stop
        ;;
  restart)
	do_sanity
	do_config
        do_restart
        ;;
esac

services.sh

#!/bin/sh

echo "
<html><head>
<style type='text/css'>
.prgbar { font-family:Arial; padding:0px; height: 20px; width: 200px; font-weight: bolder; font-size: 10pt; color: #0000FF}
select { width:175px;}
</style>
<script type='text/javascript'>

function go(service,action){

	//submit new
	d=document.getElementById('dlna')
	d.media_server_name.value=service+'#'+action
	d.submit()
	tick()
	setTimeout(function(){location.reload(true)},20000)
}

function tick()
{
	document.getElementById('body').innerHTML='<center><h1><%301%></h1><form name=tik><input type=text name=tick class=prgbar></form>'
	setInterval('document.forms[\'tik\'].tick.value += \'|\'',400)
}

</script>
<link rel=stylesheet href=form.css>
</head>
<body>

<iframe name=ifr style='visibility:hidden;display:none' height=0 width=0></iframe>

<DIV id=body>

<form id=dlna method=POST action=dlna.cgi target=ifr>
<input type=hidden name=enable_ms value=1>
<input type=hidden name=ms_active_status value=1>
<input type=hidden name=media_server_name>
</form>

<table border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr>
	<td colspan=5><h1>Network Services</h1></td>
</tr>

<tr>
	<td colspan=5 background=liteblue.gif height=12>&nbsp; </td>
</tr>
</table>

<br>
<br>

<table border='1' cellpadding='2' cellspacing='0' width='100%'>
<tr>
	<td rowspan=2>&nbsp;</td><td colspan=2 width=40%><b>Startup (toggle)</b></td><td colspan=2 width=40%><b>Live (toggle)</b></td>
</tr>
<tr>
	<td><span class=thead>Enable</span></td><td><span class=thead>Disable</span></td><td><span class=thead>Start</span></td><td><span class=thead>Stop</span></td>
</tr>

" > /www/services.htm

#main services
for i in telnetd dropbear samba nfsd minidlna transmission automatic
do
	if [[ "$(param get ${i}_enable)" = "1" ]] 
	then 
		a="checked"
		b=
		c=
		d="onClick=go('${i}','disable')" 
	else
		a=
		b="onClick=go('${i}','enable')"
 		c="checked"
		d=
	fi

	if [[ "$(param get ${i}_state)" = "1" ]] 
	then 
		e="checked"
		f=
		g=
		h="onClick=go('${i}','stop')" 
	else
		e=
		f="onClick=go('${i}','start')"
 		g="checked"
		h=
	fi

	echo "
	<tr>
		<td><b>${i}</b></td>
		<td><input name=${i}_enable type=radio $a $b></td><td><input name=${i}_enable type=radio $c $d></td>
		<td><input name=${i}_state type=radio $e $f></td><td><input name=${i}_state type=radio $g $h></td>
	</tr>
	" >> /www/services.htm
done


echo "
</table>

<br>
<br>


<table border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr>
	<td><h1>WAN Access</h1></td>
</tr>

<tr>
	<td background=liteblue.gif height=12>&nbsp; </td>
</tr>
</table>

<br>
<br>

<table border='1' cellpadding='2' cellspacing='0' width='100%'>

<tr>
	<td rowspan=2>&nbsp;</td><td colspan=2><b>Firewall (toggle)</b></td>
</tr>

<tr>
	<td><span class=thead>Enable</span></td><td><span class=thead>Disable</span></td>
</tr>

" >> /www/services.htm

#WAN firewall
for i in dropbear
do
	if [[ "$(param get ${i}_fwopen)" = "1" ]] 
	then 
		a="checked"
		b=
		c=
		d="onClick=go('${i}','fwclose')" 
	else
		a=
		b="onClick=go('${i}','fwopen')"
 		c="checked"
		d=
	fi

	echo "
	<tr> 
		<td><b>${i}</b></td>
		<td><input name=${i}_fwopen type=radio $a $b></td><td><input name=${i}_fwopen type=radio $c $d></td>
	</tr>
	" >> /www/services.htm
done

echo "
</table>

<br>
<br>


<table border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr>
	<td colspan=5 background=liteblue.gif height=12>&nbsp; </td>
</tr>
<tr>
	<td colspan=5><h1>External Service Pages</h1></td>
</tr>
<tr>
	<td colspan=5>
		<input type=button value='Transmission WebUI' onclick=\"parent.location.href=location.protocol+'//'+location.hostname+':55555'\">&nbsp;&nbsp;
		<input type=button value='ReadyDLNA Status' onclick=\"parent.location.href=location.protocol+'//'+location.hostname+':8200'\"><BR>
	</td>
</tr>
<tr>
	<td colspan=5 background=liteblue.gif height=12>&nbsp; </td>
</tr>
<tr>
	<td colspan=5><h1>System Mounts</h1></td>
</tr>
<tr>
	<td colspan=5>
		<input type=button value='Show/Hide Mounts' onclick=\"document.getElementById('m').style.display=(document.getElementById('m').style.display=='block')?'none':'block';return false;\"><br>
		<div id=m style='display:none;'><br>
		&nbsp;&nbsp;&nbsp;<span class=thead>/proc/mounts</span><br>
		<object style='width:100%; height:250px;' data='mounts'></object>
		</div>
	</td>
</tr>
<tr>
	<td colspan=5><BR>
		<input type=button value='Unmount USB' onClick=go('umountusb','now')><br>
	</td>
</tr>
<tr>
	<td colspan=5 background=liteblue.gif height=12>&nbsp; </td>
</tr>
<tr>
	<td colspan=5><h1>Router State</h1></td>
</tr>
<tr>
	<td colspan=5>
		<input type=button value='Reboot' onClick=go('reboot','now')>
		<input type=button value='Poweroff' onClick=go('poweroff','now')><br>
	</td>
</tr>
<tr>
	<td colspan=5 background=liteblue.gif height=12>&nbsp; </td>
</tr>
</table>
</DIV>
</BODY>
</html>
" >> /www/services.htm

shutdown.sh

#!/bin/sh

#sync
/bin/sync

#stop services and unmount USB
ACTION=removeall /etc/automount.sh

#stop non services
killall bcmupnp dnsmasq dnsRedirectReplyd dsldiagd ddnsd eapd email heartbeat httpd inotifyd inadyn-mt lld2d nas pppd timesync upnpd udhcpd wpsd wlanconfigd wps_monitor
sleep 1

#sync
/bin/sync

#finally unmount everything else
/bin/umount -a -r

telnetd.sh

#!/bin/sh

do_start()
{
	[[ "$(param get telnetd_enable)" = "1" ]] || exit 1
	param set telnetd_state=0
	/usr/sbin/telnetd -l/bin/sh && param set telnetd_state=1
}

do_stop()
{
	killall telnetd
	param set telnetd_state=0
}

case "$1" in
  start)
        do_start
        ;;
  stop)
        do_stop
        ;;
esac

torrent.sh

#!/bin/sh

media_dir=/media

## Transmission ##
#get config location from usb drive
	tmiss=$(find $media_dir -maxdepth 2 -follow -type d -iname "transmissionbt")
	[[ "$tmiss" ]] || exit 1

#turn all rpc to vars 
eval $(grep "rpc" "$tmiss/settings.json" | tr -d '\t \"' | tr : = | tr - _ | sed -e "s/,$//")

## Automatic ##
#turn all to vars 
eval $(grep -v '""' "$tmiss/automatic.settings" | tr -d '\t ' | tr - _)
eval $(grep -v '""' "$tmiss/automatic.data" | grep "=>" | tr -d '\t >')


echo "
<html><head>
<style type='text/css'>
.prgbar { font-family:Arial; padding:0px; height: 20px; width: 200px; font-weight: bolder; font-size: 10pt; color: #0000FF}
</style>
<script type='text/javascript'>

	//object of current values
	var arr = new Array();
	arr['rpc-authentication-required'] = '${rpc_authentication_required}'
	arr['start-torrents'] = '${start_torrents}'

onload=function(){
	//change all select values
	var s=''
	for(k in arr){
		e = document.getElementById(k)
		for (j = 0; j < e.length; j++) {
			if (e.options[j].value == arr[k]) {e.selectedIndex = j}
		}
	}
}

function update(t){
	//update string on change
	var s=''
	tor=document.getElementById(t)
	all = tor.getElementsByTagName('*')
	t=='transmissionset' ? r=RegExp('\x22|\x27|#','gi') : r=RegExp('\x22|\x27|#| |{|}','gi') //input sanitizer
	for (i = 0; i < all.length; i++) {
		if (all[i].nodeName == 'SELECT' || all[i].nodeName == 'INPUT') {
			id=all[i].getAttribute('id')
			if (id !== null) {
				e=document.getElementById(id)
				if (e.value !== '') {
					s=s+'#'+id+'=\"'+e.value.replace(r,'').trim()+'\"'
				}
			}
		}
	}
	document.getElementById('dlna').media_server_name.value=s
}

function go(t){
	//submit changes
	d=document.getElementById('dlna')
	update(t)
	d.media_server_name.value=t+d.media_server_name.value
	d.submit()
	tick()
	setTimeout(function(){location.reload(true)},20000)
}

function tick()
{
	document.getElementById('body').innerHTML='<center><h1><%301%></h1><form name=tik><input type=text name=tick class=prgbar></form>'
	setInterval('document.forms[\'tik\'].tick.value += \'|\'',400)
}

</SCRIPT>
<link rel=stylesheet href=form.css>
</head>
<body>

<iframe name=ifr style='visibility:hidden;display:none' height=0 width=0></iframe>

<DIV id=body>


<table id=transmissionset border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr>
	<td colspan=2><h1>Transmission Security</h1></td>
</tr>

<tr>
	<td colspan=2 background=liteblue.gif height=12>&nbsp; </td>
</tr>

<tr>
	<td width=130>RPC auth required</td>
	<td>
		<select id=rpc-authentication-required>
		<option value=true selected>Yes</option>
		<option value=false>No</option>
		</select>
	</td>
</tr>

<tr>
	<td width=130>RPC username</td>
	<td>
		<input style=width:380px type=input id=rpc-username value='$rpc_username'>
	</td>
</tr>

<tr>
	<td width=130>RPC password</td>
	<td>
		<input style=width:380px type=input id=rpc-password value='$rpc_password'>
	</td>
</tr>


<tr>
	<td width=130>RPC whitelist</td>
	<td>
		<input style=width:380px type=input id=rpc-whitelist value='$rpc_whitelist'>
	</td>
</tr>

<tr>
	<td colspan=2><br>
		<input type=button value=Apply onClick=go('transmissionset')>
	</td>
</tr>
</table>

<br><br>

<table id=automaticsetsec border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr>
	<td colspan=2><h1>Automatic</h1></td>
</tr>

<tr>
	<td colspan=2 background=liteblue.gif height=12>&nbsp; </td>
</tr>
<tr>
	<td width=130>RPC auth (user:pass)<br> to Transmission<br> </td>
	<td>
		<input style=width:200px type=input id=rpc-auth value='$rpc_auth'>
	</td>
</tr>

<tr>
	<td width=130>RSS poll (min)</td>
	<td>
		<input style=width:200px type=input id=interval value='$interval'>
	</td>
</tr>

<tr>
	<td width=130>Prowl API key</td>
	<td>
		<input style=width:200px type=input id=prowl-apikey value='$prowl_apikey'>
	</td>
</tr>

<tr>
	<td width=80>Start added torrents</td>
	<td>
		<select id=start-torrents>
		<option value=yes selected>Auto Start</option>
		<option value=no>Add Only</option>
		</select>
	</td>
</tr>

<tr>
	<td colspan=2>
		<input type=button value=Apply onClick=go('automaticsetsec')>
	</td>
</tr>
</table>

<br>
<table border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr>
	<td background=liteblue.gif height=12>&nbsp; </td>
</tr>
</table>

<table id=automaticsetu12 border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr><td><br><b>RSS Feed URLs</b><br><br></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=url1 value='$url1'></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=url2 value='$url2'></td></tr>
<tr><td style='padding-left: 20px;'><input type=button value=Apply onClick=go('automaticsetu12')></td></tr>
</table>

<table id=automaticsetu34 border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=url3 value='$url3'></td>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=url4 value='$url4'></td></tr>
<tr><td style='padding-left: 20px;'><input type=button value=Apply onClick=go('automaticsetu34')></td></tr>
</table>

<table id=automaticsetu56 border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=url5 value='$url5'></td>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=url6 value='$url6'></td></tr>
<tr><td style='padding-left: 20px;'><input type=button value=Apply onClick=go('automaticsetu56')></td></tr>
</table>

<br>
<table border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr>
	<td background=liteblue.gif height=12>&nbsp; </td>
</tr>
</table>

<table id=automaticsetp12 border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr><td><br><b>Filter (PCRE Syntax)</b><BR>&nbsp;&nbsp;&nbsp;&nbsp;[Optional Target Sub-Folder]<br><br></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=pattern1 value='$pattern1'></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:400px type=text id=folder1 value='$folder1'></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=pattern2 value='$pattern2'></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:400px type=text id=folder2 value='$folder2'> <input type=button value=Apply onClick=go('automaticsetp12')></td></tr>
<tr><td></td></tr>
</table>

<table id=automaticsetp34 border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=pattern3 value='$pattern3'></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:400px type=text id=folder3 value='$folder3'></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=pattern4 value='$pattern4'></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:400px type=text id=folder4 value='$folder4'> <input type=button value=Apply onClick=go('automaticsetp34')></td></tr>
</table>

<table id=automaticsetp56 border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=pattern5 value='$pattern5'></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:400px type=text id=folder5 value='$folder5'></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:500px type=text id=pattern6 value='$pattern6'></td></tr>
<tr><td style='padding-left: 20px;'><input style=width:400px type=text id=folder6 value='$folder6'> <input type=button value=Apply onClick=go('automaticsetp56')></td></tr>
</table>

		<form id=dlna method=POST action=dlna.cgi target=ifr>
		<input type=hidden name=enable_ms value=1>
		<input type=hidden name=ms_active_status value=1>
		<input type=hidden name=media_server_name>
		</form>

<table border='0' cellpadding='0' cellspacing='3' width='100%'>
<tr>
	<td colspan=2 background=liteblue.gif height=12>&nbsp; </td>
</tr>

<tr>
	<td colspan=2><h1>System Log</h1></td>
</tr>

<tr>
	<td colspan=2>
		<input type=button value='Show/Hide Syslog' onclick=\"document.getElementById('sys').style.display=(document.getElementById('sys').style.display=='block')?'none':'block';return false;\"><br>
		<div id=sys style='display:none;'><br>
		&nbsp;&nbsp;&nbsp;<span class=thead>/var/log/messages</span><br>
		<object style='width:100%; height:250px;' data='messages'></object>
		</div>
	</td>
</tr>

<tr>
	<td colspan=2 background=liteblue.gif height=12>&nbsp; </td>
</tr>

<tr>
	<td colspan=2><h1>Automatic Log</h1></td>
</tr>

<tr>
	<td colspan=2>
		<input type=button value='Show/Hide Log' onclick=\"document.getElementById('aut').style.display=(document.getElementById('aut').style.display=='block')?'none':'block';return false;\"><br>
		<div id=aut style='display:none;'><br>
		&nbsp;&nbsp;&nbsp;<span class=thead>$tmiss/automatic.log</span><br>
		<object style='width:100%; height:250px;' data='automatic.log'></object>
		</div>
	</td>
</tr>
<tr>
	<td colspan=2 background=liteblue.gif height=12>&nbsp; </td>
</tr>
</table>
<br><br>
</DIV>
</BODY>
</html>
" > /www/torrent.htm

transmission.sh

#!/bin/sh

media_dir=/media

do_sanity()
{

	[[ "$(param get transmission_enable)" = "1" ]] || exit 1
	param set transmission_state=0
	tmiss=$(find $media_dir -maxdepth 2 -follow -type d -iname "transmissionbt")
	[[ "$tmiss" ]] || exit 1
	export HOME="$tmiss"
	export TRANSMISSION_HOME="$tmiss"
}

do_config()
{
	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#/.*/transmissionbt/#$tmiss/#g" "$tmiss/settings.json" #fixes if location moved
	fi
}

do_restart()
{
	pidof transmission-daemon && { killall -HUP transmission-daemon && param set transmission_state=1; } || do_start
}

do_start()
{
	[[ "$(ls ${media_dir})" ]] || exit 1
	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
	#open firewall
	/bin/nat5 agApi_setDeviceListenPortRange 2 55555 55800 0
	#show firewall openings
	#/bin/nat5 agApi_fwListenPortList 0 0 0 0
	nice -n 18 /bin/transmission-daemon -x /var/run/transmission.pid && param set transmission_state=1
}

do_stop()
{	
	/bin/sync
	killall transmission-daemon
	sleep 2
	killall -9 transmission-daemon
	#on this range once shut it wont reopen so dont shut
	# /bin/nat5 agApi_setDeviceListenPortRange 2 55555 55554 0
	param set transmission_state=0
}


case "$1" in
  start)
	do_sanity
	do_config
        do_start
        ;;
  stop)
        do_stop
        ;;
  restart)
	do_sanity
	do_config
        do_restart
        ;;
esac

watch.sh

#!/bin/sh
#uses obsolete minidlna setting from netgear httpd
#triggered by inotifyd , from creation of /tmp/minidlna.conf from dlna.cgi submission.
#data passed via now obsolete param 'dlna_media_server_name' also set  by dlna.cgi

#v formatted service#action
v=$(param get dlna_media_server_name)

#activity log, split long strings for syslogd
i=0
while [ ${v:$i:200} ]
do
	logger -t watch.sh "DEBUG($i) ${v:$i:200}"
	i=$(expr $i + 200)
done

#debug
#cp /tmp/minidlna.conf /tmp/$(date | tr " :" "-")minidlna.conf

#triggers twice per submission, only want first
[[ "$v" = "ReadySHARE" ]] && exit

#reset to stop second trigger
param set dlna_media_server_name=ReadySHARE

service=${v%%#*}
action=${v#*#}
media_dir=/media

case "${action}" in
enable)
	#enable/disable state
	$(param set ${service}_enable=1)
	$(param save)
	;;
disable)
	$(param set ${service}_enable=0)
	$(param save)
	;;
start|stop)
	#start/stop service
	/etc/init.d/${service}.sh ${action}
	;;
fwopen)
	#open WAN firewall for service
	$(param set ${service}_fwopen=1)
	/etc/init.d/${service}.sh ${action}
	$(param save)
	;;
fwclose)
	#close WAN firewall for service
	$(param set ${service}_fwopen=0)
	/etc/init.d/${service}.sh ${action}
	$(param save)
	;;
esac

case "${service}" in
transmissionset)
	#hash delimited with quotes intact
	tmiss=$(find $media_dir -maxdepth 2 -follow -type d -iname "transmissionbt")
	[[ "$tmiss" ]] || exit 1
	/etc/init.d/transmission.sh stop
	cp "$tmiss/settings.json" "$tmiss/settings.json.bak"
	echo "$action" | tr "#" "\n" | while read i
	do
		k=${i%%=*} ; [[ "$k" ]] || break; v=${i#*=} ; [[ "$k" ]] || break;
		sed -i "/\"$k\"/s#: .*#: $v,#" "$tmiss/settings.json"
	done
	/etc/init.d/transmission.sh start
	;;
automaticset*)
	#hash delimited with quotes intact
	tmiss=$(find $media_dir -maxdepth 2 -follow -type d -iname "transmissionbt")
	[[ "$tmiss" ]] || exit 1
	cp "$tmiss/automatic.data" "$tmiss/automatic.data.bak" ; cp "$tmiss/automatic.settings" "$tmiss/automatic.settings.bak"
	echo "$action" | tr "#" "\n" | while read i
	do
		k=${i%%=*} ; [[ "$k" ]] || break; v=${i#*=} ; [[ "$k" ]] || break; v="${v//&/\&}";
		[[ ${service} == "automaticsec" ]] && sed -i "/$k/s#=.*#= $v#" "$tmiss/automatic.settings" || sed -i "/$k/s#=>.*#=> $v#" "$tmiss/automatic.data" 
	done
	/etc/init.d/automatic.sh restart
	;;
adslset)
	/bin/adslctl configure ${action}
	$(param set adsl_value="${action}")
	$(param save)
	;;
inadynset)
	killall -HUP inadyn-mt; sleep 1
	nice -19 /bin/inadyn-mt --background ${action}
	$(param set inadyn_value="${action}")
	$(param save)
	;;
umountusb)
	ACTION=removeall /etc/automount.sh
	;;
reboot)
	/sbin/reboot && exit
	;;
poweroff)
	/sbin/poweroff && exit
	;;
esac

sleep 1
#regenerate web pages
/etc/services.sh
/etc/adsl.sh
/etc/dynamicdns.sh
/etc/torrent.sh

Rebuild

This is just for me so I can quickly rebuild the above if needs be.

rm /tmp/p.txt
find -maxdepth 1 -type f -not -name "*~" -printf "%f\n" | xargs grep -Il . | sort | while read i ; do echo -e "\n==$i==\n\n<syntaxhighlight lang=\"bash\">" >> /tmp/p.txt ; 
cat $i >> /tmp/p.txt; echo -e "</syntaxhighlight>" >>  /tmp/p.txt  ; done


Comments

blog comments powered by Disqus


See Also