Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Thu Mar 05, 2015 12:39 pm
I tried again and this time i do all steps manually and overvwrite only scp binary.
still no improvments...
is your posted pack the same in download area?
now i'm going to try the telnet fix pack in download area.
maybe is beacuse i have the telnet started at tv start?
My rcEXT
My rcSGO
my rc.fix_telnetd
my rc.sysinit
Any hints?
if i start ssh i got this error
still no improvments...
is your posted pack the same in download area?
now i'm going to try the telnet fix pack in download area.
maybe is beacuse i have the telnet started at tv start?
My rcEXT
Code: Select all
/dtv/usb/sda1/SamyGO # ls
bin etc opt rcSGO usr
clmeta.dat lib phpsysinfo samygo.log
doc mc rcEXT sbin
/dtv/usb/sda1/SamyGO # cat rcEXT
#!/bin/sh
source /dtv/SGO.env
#echo "alias sgopwd='cd $1'" >> /dtv/SGO.env
echo "#!/dtv/network_opt/sh" > /dtv/sgoshfix
echo ". /dtv/SGO.env" >> /dtv/sgoshfix
echo "export HOME=\"$1\"" >> /dtv/sgoshfix
echo "export TERMINFO='$1/etc/terminfo'" >> /dtv/sgoshfix
echo "export TERM='xterm-color'" >> /dtv/sgoshfix
echo "export FRAMEBUFFER='/dev/sam/fb0'" >> /dtv/sgoshfix
echo "export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"" >> /dtv/sgoshfix
echo "export PATH=\"$PATH\"" >> /dtv/sgoshfix
echo "export SYSROOT=\"$SYSROOT\"" >> /dtv/sgoshfix
echo "export PS1='\u@tv:\w \\$ '" >> /dtv/sgoshfix
chmod +x /dtv/sgoshfix
ln -s "$SYSROOT/opt/privateer/usr/bin/" /dtv/bin
$1/etc/rc.fix_telnetd&/dtv/usb/sda1/SamyGO #
Code: Select all
/dtv/usb/sda1/SamyGO # cat rcSGO
#!/bin/sh
#
# ? Copyright 1996-2010, ZsoltTech.Com
# by Ser Lev Arris <arris@ZsoltTech.Com>
#
# donated for the SamyGo Project
# http://samygo.sourceforge.net/
#
# Version: SamyGO-CoreScript svn $Id: rcSGO 1114 2011-03-28 09:10:16Z arris69 $
# do some background checks (not implemented/need)
if [ ! -e /dtv/SGO.env ] ; then
# some helper stuff
alias .='source'
# if running as real linuxrc
if [ ! -e /proc/mounts ]; then
mount -n -t proc /proc /proc
mount -n -t sysfs /sys /sys >/dev/null 2>&1
fi
# make our mount happy, but this breaks djmount so revert it.
# /bin/mount -o bind /proc/mounts /etc/mtab
KERN_VER=$(cat /proc/version | sed -e 's/\(.*inux version \)\(.*\) \(.*@.*\)$/\2/')
# for lsusb
# mount -n -t usbfs usbfs /proc/bus/usb
if [ -x /etc/rc.early.local ]; then
echo ". /etc/rc.early.local" 1>&2
fi
if [ -d /mtd_wiselink ] ; then
NEW_HOME="/mtd_wiselink"
elif [ -d /mtd_contents ] ; then
NEW_HOME="/mtd_contents"
elif [ -d /dtv ] ; then
NEW_HOME="/dtv"
else
NEW_HOME="/sdcard"
fi
# harden
if [ ! -e /mtd_rwarea/passwd ]; then
echo "root:saJvQKUdIxRW2:0:0:SamyGO secured Root:$NEW_HOME:/bin/sh" > /mtd_rwarea/passwd
fi
mount -o bind /mtd_rwarea/passwd /etc/passwd
# do the work (try to find SamyGO or start telnetd)
# other user scripts are not supported SamyGO has
# extensions for automount etc...
# feature requests at: http://samygo.sourceforge.net/
# just here for testing
S_SCRIPT="echo Bummer >> /dev/kmsg"
# http://sourceforge.net/apps/phpbb/samygo/viewtopic.php?f=4&t=207&start=0&hilit=libSamyGO
# samyGo use on LN52A850 (T-SPHAUSC v.1004)
# Postby tskitishvili ? Wed Dec 16, 2009 2:56 am
# ... no cut in busybox
if [ ! -z $1 ] ; then
if [ -x "$1"/etc/rc.sysinit ] ; then
SYSROOT="$1"
S_SCRIPT="cd $1 ; ./etc/rc.sysinit 2>&1 &"
fi
else
for SYSROOT in ${1:- \
/dtv/usb/sd*/SamyGO \
/dtv/usb/sd*/*/SamyGO \
/dtv/usb/sd*/*/*/SamyGO \
/mtd_tlib/SamyGO \
/mtd_tlib/*/SamyGO \
/mtd_tlib/*/*/SamyGO \
/mtd_down/SamyGO \
/mtd_contents/SamyGO \
/mtd_rwcommon/SamyGO \
/mtd_wiselink/SamyGO} ; do
if [ -x $SYSROOT/etc/rc.sysinit ] ; then
S_SCRIPT="cd $SYSROOT ; ./etc/rc.sysinit 2>&1 &"
break
# if no extension installed try telnet
elif [ -x /etc/telnetd_start.sh ] ; then
S_SCRIPT="/etc/telnetd_start.sh &"
else
echo "rc script not found in $SYSROOT"
# this should work on A and C series if we shipp busybox
# /etc/telnetd_start.sh isn't existent?
if [ `cat /proc/mounts | grep -c "devpts"` -gt "0" ] ; then
echo "devpts is mounted, nothing to do"
else
# hope this won't break boot process
mount -n -t devpts devpts /dev/pts
fi
# this isn't realy supported for now
# busybox telnetd forks perse, but who knows...
S_SCRIPT="$SYSROOT/bin/busybox telnetd 2>&1 &"
# TV has no nic -> first get usb wifi working
# # T-RBYDEU -> no telnet start script, has inetd
# ifconfig lo 127.0.0.1
# # hmm
# mount -t devpts devpts /dev/pts
# S_SCRIPT="/usr/sbin/inetd >/dev/null 2>&1 &"
fi
done
fi
echo "SYSROOT=\"$SYSROOT\"" > /dtv/SGO.env
echo "MOUNT_PATH=\"MountPlaceholder\"" >> /dtv/SGO.env
echo "export MOD_DIR=$SYSROOT/lib/modules/$KERN_VER" >> /dtv/SGO.env
echo "export TMPDIR=/dtv" >> /dtv/SGO.env
echo "export HOME=$NEW_HOME" >> /dtv/SGO.env
echo "export SMB_CONF_PATH=\"$SYSROOT/etc/samba/smb.conf\"" >> /dtv/SGO.env
echo "LOGFILE=\"$SYSROOT/samygo.log\"" >> /dtv/SGO.env
else
S_SCRIPT="echo Skip >> /dev/kmsg"
fi
# go to sed due busybox on T-SPHAUSC
# echo "SYSROOT=\"$(echo "$S_SCRIPT" | cut -d " " -f2)\"" > /dtv/SGO.env
# is already set
# echo "SYSROOT=\"$(echo "$S_SCRIPT" | sed 's/cd \(.*\) ;.*/\1/')\"" > /dtv/SGO.env
eval $S_SCRIPT
$1/rcEXT "$1"
/dtv/usb/sda1/SamyGO #
Code: Select all
/dtv/usb/sda1/SamyGO/etc # cat rc.fix_telnetd
#!/bin/sh
killall telnetd
. /dtv/sgoshfix
cd
Code: Select all
/dtv/usb/sda1/SamyGO/etc # cat rc.sysinit
#!/bin/sh
#
# ? Copyright 1996-2010, ZsoltTech.Com
# by Ser Lev Arris <arris@ZsoltTech.Com>
#
# donated for the SamyGo Project
# http://samygo.sourceforge.net/
#
# Version: SamyGO-sysinit svn $Id: rc.sysinit 1148 2011-06-07 19:49:16Z arris69 $
# some helper stuff
alias .='source'
bummer()
{
echo "$1"
exit 0
}
p_from_rel_info()
{
if [ -e $1 ]; then
DISTROOT="$SYSROOT/opt/$(sed q "$1" | sed 's/^\(\w*\) *.*/\1/')"
else
DISTROOT="$SYSROOT"
fi
}
find_self()
{
# on start holds export SYSROOT="<whatever>", written from
# starterlib or rcSGO
source /dtv/SGO.env
}
# if running as real rcS
if [ ! -e /proc/mounts ]; then
/bin/mount -n -t proc /proc /proc
/bin/mount -n -t sysfs /sys /sys >/dev/null 2>&1
fi
if [ -x /etc/rc.early.local ]; then
echo ". /etc/rc.early.local" 1>&2
fi
# build runtime enviroment (set path and lib locations)
find_self
p_from_rel_info $SYSROOT/etc/release
export LD_LIBRARY_PATH="$DISTROOT/lib:$DISTROOT/usr/lib:$SYSROOT/lib:$SYSROOT/usr/lib:$LD_LIBRARY_PATH"
export PATH="$DISTROOT/sbin:$DISTROOT/bin:$DISTROOT/usr/bin:$DISTROOT/usr/sbin:$SYSROOT/sbin:$SYSROOT/bin:$SYSROOT/usr/bin:$SYSROOT/usr/sbin:$PATH"
# export LD_PRELOAD=""
echo "LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"" >> /dtv/SGO.env
echo "PATH=\"$PATH\"" >> /dtv/SGO.env
echo "export ENV=\"/dtv/.ashrc\"" >> /dtv/SGO.env
echo "export FRAMEBUFFER=\"/dev/sam/fb0\"" >> /dtv/SGO.env
echo "export DISTROOT=\"$DISTROOT\"" >> /dtv/SGO.env
# bit comfort after login and disable samsung grap
echo "export PATH=\"$PATH:/usr/sbin:/usr/bin:/bin:/sbin\"" > /mtd_rwarea/profile
echo "export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"" >> /mtd_rwarea/profile
echo "export SCREENDIR=/dtv/screen" >> /mtd_rwarea/profile
#echo "export PS1='# '" >> /mtd_rwarea/profile
echo "PS1='\u@tv:\w \# '" >> /mtd_rwarea/profile
echo -e "ENV=/dtv/.ashrc\nexport ENV\n" >> /mtd_rwarea/profile
echo ". /dtv/sgoshfix" >> /mtd_rwarea/profile
mount -o bind /dtv/network_opt/sh /bin/sh
echo -e "ENV=/dtv/.ashrc\nexport ENV\n" >> /mtd_rwarea/profile
/bin/mount -o bind /mtd_rwarea/profile /etc/profile
echo "alias ll='ls -l'" > /dtv/.ashrc
echo "alias md='mkdir -p'" >> /dtv/.ashrc
echo "alias vi='busybox vi'" >> /dtv/.ashrc
echo "PATH=\"$PATH\"" >> /dtv/.ashrc
echo "LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"" >> /dtv/.ashrc
echo "FRAMEBUFFER=\"/dev/sam/fb0\"" >> /dtv/.ashrc
echo "TERMINFO=\"$SYSROOT/etc/terminfo\"" >> /dtv/.ashrc
echo "TMPDIR=\"/dtv\"" >> /dtv/.ashrc
echo "export PATH LD_LIBRARY_PATH FRAMEBUFFER TMPDIR TERMINFO" >> /dtv/.ashrc
if [ -x $DISTROOT/sbin/depmod ] ; then
$DISTROOT/sbin/depmod -v -b $SYSROOT
fi
# we don't use real init (for now)
# v0.03 disabled stop sequence
# for i in `ls -r $SYSROOT/etc/init.d/*.init` ; do
# echo $i stop # hmmmmm
# done
for i in $SYSROOT/etc/init.d/*.init ; do
$i start # hmmmmm
done
/dtv/usb/sda1/SamyGO/etc #
if i start ssh i got this error
Code: Select all
login as: root
root@192.168.1.164's password:
-sh: .: line 8: can't open /dtv/sgoshfix
\u@tv:\w \#