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 2010-03-29 17:32:02

kopeq
New member
Registered: 2010-03-29
Posts: 1

chroot debian, DNS 323 rev C1 running 1.07, add other fun_plug scripts

Hi, I have chroot debian running on my 323 and I want to install the fan control script.
see: http://dns323.kood.org/hardware:fan
Now, do I add (and configure) the instructions from that fun_plug file to my own fun_plug (that chroots debian) or should I somehow invoke the scripts once debian has booted?

In general, when I would want to add other fun_plug functionalities which I can't or want to realize with debian, can I just merge the corresponding fun_plug scripts with the fun_plug that chroots debian or is that gonna cause problems

my current fun_plug

Code:

#!/bin/sh

# Root DISK1
export DISK1=/mnt/HD_a2
export DISTDIR=linux

cd $DISK1

mount --bind $DISK1 $DISTDIR$DISK1
mount --bind / $DISTDIR/mnt/root
mount --bind /dev $DISTDIR/dev
mount --bind /sys  $DISTDIR/sys
mount --bind /sys/crfs $DISTDIR/sys/crfs
mount --bind /web $DISTDIR/web
mount --bind /proc $DISTDIR/proc

cp -f /proc/mounts $DISTDIR/etc/mtab
rm -f $DISTDIR/etc/fstab
touch $DISTDIR/etc/fstab
cp -f /etc/resolv.conf $DISTDIR/etc
hostname >$DISTDIR/etc/hostname
cp -f /etc/hosts $DISTDIR/etc

$DISK1/$DISTDIR/boot/chroot $DISK1/$DISTDIR /boot/linuxrc

and the fun_plug from the fan control "package"

Code:

#!/bin/sh

VOL1=/mnt/HD_a2
VOL2=/mnt/HD_b2
FUNPLUGTAR=${VOL1}/fun_plug.tar
FUNPLUGDIR=${VOL1}/fun_plug.d
ETCDIR=${FUNPLUGDIR}/etc
BINDIR=${FUNPLUGDIR}/bin
SBINDIR=${FUNPLUGDIR}/bin
LIBDIR=${FUNPLUGDIR}/lib
LOGDIR=${FUNPLUGDIR}/log
LOGFILE=${LOGDIR}/fun_plug.log
PATH=${BINDIR}:${PATH}
LD_LIBRARY_PATH=${LIBDIR}

export VOL1
export VOL2
export FUNPLUGDIR
export ETCDIR
export BINDIR
export LIBDIR
export LOGDIR
export LOGFILE
export PATH
export LD_LIBRARY_PATH

umask 022

mkdir -p ${FUNPLUGDIR} ${LOGDIR}
echo "**** fun_plug script for DNS-323 (2007-07-22 tp@fonz.de) ****" >>${LOGFILE}
date >>${LOGFILE}

if [ -r "${FUNPLUGTAR}" ]; then
    echo "* Extracting ${FUNPLUGTAR}..." >>${LOGFILE}
    /bin/tar -xv -f ${FUNPLUGTAR} -C ${FUNPLUGDIR} 1>>${LOGFILE} 2>&1
    echo "* Deleting ${FUNPLUGTAR}..." >>${LOGFILE}
    rm -f ${FUNPLUGTAR}
fi

# suid busybox
if [ -e ${BINDIR}/busybox ]; then
    chown root.root ${BINDIR}/busybox
    chmod 0755 ${BINDIR}/busybox
    chmod u+s ${BINDIR}/busybox
fi

echo "${LIBDIR}" >>/etc/ld.so.conf
ldconfig

if [ -d "${FUNPLUGDIR}/start" ]; then
    for fun_plug_script in ${FUNPLUGDIR}/start/*.sh; do
        if [ -x "${fun_plug_script}" ]; then
            echo "* Running ${fun_plug_script} start ..." >>${LOGFILE}
            ${fun_plug_script} start 1>>${LOGFILE} 2>&1
        else
            echo "* ${fun_plug_script} not executable..." >>${LOGFILE}
        fi
    done
else
    echo "* ${FUNPLUGDIR}/start: Directory not found"
fi

echo "* Done" >>${LOGFILE}
/mnt/HD_a2/ctrl_fanspeed.sh

Thank you in advance

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB