DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-01-05 18:54:06

bound4h
Member
Registered: 2010-04-12
Posts: 209

Installing Optware

Trying to edit an old startup script of optware (below) that references the new 0.5ffp.  Is there any need for the:

if [ ! -e /etc/passwd.orig ]; then   
  cp /etc/passwd /etc/passwd.orig
fi

or the:

sed -i 's@:/bin/sh$@:/mnt/HD_a2/fun_plug.d/bin/sh@' /etc/passwd

lines?

If so, I know I will need to change the fun_plug.d to just ffp to account for 0.5 version.  I just can't see any reason why copying the passwd file to a backup and then changing the shells to the the /ffp/bin/sh since ffp0.5 already does this?  Am I wrong?

#!/bin/sh

# /mnt/HD_a2/fun_plug.d/start/optware.sh

# This script sets up the folders and paths that are expected
# by the optware binary packages.

# This script intended to be placed in the fun_plug.d/start directory
# and given execute permissions so that it will be started automatically
# by fonz fun_plug 0.4: http://www.inreto.de/dns323/fun-plug/0.4/

echo "*Optware Create and mount /opt for ipkg applications" >>${LOGFILE}
mkdir -p /opt
mount --bind /mnt/HD_a2/ipkg/opt /opt
# NB: The fun_plug bin directories end up in front of optware.
export PATH=/opt/bin:/opt/sbin:$PATH

echo "*Optware Don't use the built in shell as it is locked" >>${LOGFILE}
# We expect this script to be run from fonz fun_plug version 0.4 which
# provides an unlocked and more recent busybox.
# Save the unmodified passwd file:
if [ ! -e /etc/passwd.orig ]; then   
  cp /etc/passwd /etc/passwd.orig
fi
# Replace /bin/sh with /mnt/HD_a2/fun_plug.d/bin/sh:
sed -i 's@:/bin/sh$@:/mnt/HD_a2/fun_plug.d/bin/sh@' /etc/passwd

echo "*Optware starting optware services" >>${LOGFILE}
# Add calls to selected start scripts for packages that you install from optware here:
#/opt/etc/init.d/S40sshd start

# Or start all services that have an Optware start script:
# http://trac.nslu2-linux.org/optware/bro … rc.optware
for i in /opt/etc/init.d/S??* ;do 
  # Ignore dangling symlinks (if any).
  [ ! -f "$i" ] && continue
 
  case "$i" in
     *.sh)
          # Source shell script for speed.
          (
                  trap - INT QUIT TSTP
                  set start
                  . $i
          )
          ;;
     *)
          # No sh extension, so fork subprocess.
          $i start
          ;;
  esac
done

Last edited by bound4h (2011-01-05 19:16:54)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB