Differences

This shows you the differences between the selected revision and the current version of the page.

dns-320 2014/08/13 23:36 dns-320 2021/01/06 20:56 current
Line 630: Line 630:
\\ \\
\\ \\
 +
Line 635: Line 636:
===== Setting up Debian in chrooted enviroment ===== ===== Setting up Debian in chrooted enviroment =====
-D-Link has recently put a prebuilt Debian Squeeze package on their [[ftp://ftp.dlink.pl/dns/dns-320/driver_software/DNS-320%26325_linuxDebian_revA_Squeeze_all_en_20110111.zip|ftp]] site. The package size is approximately 150 MB. Read the instruction inside. You may have to modify ''--bind'' (dash-dash-bind) to ''--rbind'' (dash-dash-rbind) for the ''/proc'' (and possibly ''/dev'') mounts in fun_plug.debian to get some usb devices (e.g. the DS9490R USB-1wire adapter) to work properly in squeeze.+D-Link put a prebuilt Debian Squeeze package on their [[ftp://ftp.dlink.pl/dns/dns-320/driver_software/DNS-320%26325_linuxDebian_revA_Squeeze_all_en_20110111.zip|ftp]] site, in 2011. The package size is approximately 150 MB. Read the instruction inside. You may have to modify ''--bind'' (dash-dash-bind) to ''--rbind'' (dash-dash-rbind) for the ''/proc'' (and possibly ''/dev'') mounts in fun_plug.debian to get some usb devices (e.g. the DS9490R USB-1wire adapter) to work properly in squeeze.
-the prebuilt Debian Squeeze package is NO LONGER available (anywhere?)as of july 2014, with no alternative build options ,compiling new apps are left to only the semi pro devs that can create their own dev systems.+The prebuilt Debian Squeeze package is NO LONGER available through the D-Link FTP, as of july 2014, but a backup is listed on this [[https://code.google.com/archive/p/funplug-dns320-dns325/downloads|Google Code]] page.
===== Source code for firmware ==== ===== Source code for firmware ====
Line 708: Line 709:
<code> source build_fw </code> <code> source build_fw </code>
this will result in a file "DNS320-firmware" in the merge folder, which can be flashed to the unit via the webinterface (firmware update). this will result in a file "DNS320-firmware" in the merge folder, which can be flashed to the unit via the webinterface (firmware update).
-Right now the build_fw script does not do a full rebuild of the complete firmware, it rather puts together precompiled binaries that come with the built environment. [[http://forum.dsmg600.info/viewtopic.php?pid=41860#p41860|Here]] is an attempt at rebuilding the build script. [[http://curvedbrain.org/2008/06/09/building-firmware-binary-image-d-link-dns-323/|This]] blog post describes how to assemble a firmware image for the [[http://wiki.dns323.info/start|DNS-323]] and will probably helpful for the DNS-320 as well.+Right now the build_fw script does not do a full rebuild of the complete firmware, it rather puts together precompiled binaries that come with the built environment. [[http://dns323.kood.org/forum/viewtopic.php?pid=41860#p41860|Here]] is an attempt at rebuilding the build script. [[http://curvedbrain.org/2008/06/09/building-firmware-binary-image-d-link-dns-323/|This]] blog post describes how to assemble a firmware image for the [[http://wiki.dns323.info/start|DNS-323]] and will probably helpful for the DNS-320 as well.
Use this  custom build_fw to make a custom settings for the kernel Use this  custom build_fw to make a custom settings for the kernel
Line 993: Line 994:
        if (extract_frimware)         if (extract_frimware)
        {         {
-            firmware_unpack_extract(flashfilename, configfilename, dnsHeader.DefaultOffset, dnsHeader.+            firmware_unpack_extract(flashfilename, configfilename, dnsHeader.DefaultOffset, dnsHeader.DefaultLenght);
-code ]; then +
-  tar -xzf linux-2.6.22.18.tgz +
-fi +
- +
-# config our kernel and build it +
-cd ./linux-2.6.22.18 +
-sh cv.sh +
-make c +
-====== DNS-320 ====== +
-This page will share some more information about the [[http://www.dlink.co.uk/cs/Satellite?c=Product_C ]; then +
-  mv merge/uImage merge/uI, mage.org +
-fi +
- +
-if [ -f dns320flash -x dlink320firmware -o kernel ramdisk image config\nDNS323D1Ulean +
-make menuconfig +
-make +
-make modules +
-make uImage +
-cd ../ +
- +
-# Dlink run merge now +
-if [ ! -d uRamDiskefaultLenght);+
            printf("Default        Checksum file : %08x\n\n",calc_checksum(configfilename));             printf("Default        Checksum file : %08x\n\n",calc_checksum(configfilename));
        }         }
        else         else
-        { printf("\/coden"); }+        { printf("\n"); }
Line 1304: Line 1283:
===== Other info ===== ===== Other info =====
-The following [[http://forum.dsmg600.info/viewtopic.php?id=6094|thread]] handles some DNS-320 initial conversation, request there if you want some specific info here, or add yourself.+The following [[http://dns323.kood.org/forum/viewtopic.php?id=6094|thread]] handles some DNS-320 initial conversation, request there if you want some specific info here, or add yourself.
Line 1373: Line 1352:
Connect: ''ssh root@dns_ip'' Connect: ''ssh root@dns_ip''
 +
 +
 +
===== Detect USB button pressure ===== ===== Detect USB button pressure =====
Line 1382: Line 1364:
I'm not sure it's required to open /dev/REG each time, but it's what the official program does. I'm not sure it's required to open /dev/REG each time, but it's what the official program does.
Idem for the open attributes. Idem for the open attributes.
 +
 +I've created :
 +
 +* ffp/extra/shutdown/chkbutton (gcc -static -s chkbutton.c -o chkbutton)
 +
 +* /ffp/extra/shutdown/shutdown_ffp.sh
 +
 +* /ffp/extra/shutdown/usbOff.sh
 +
 +* /ffp/etc/fun_plug.local
 +
 +Just copy these files or feel free to modify them.
Files are available here : http://nadenislamarre.free.fr/dns320 Files are available here : http://nadenislamarre.free.fr/dns320
<code> <code>
-// chkbutton.c+# chkbutton.c 
#define _GNU_SOURCE 1 #define _GNU_SOURCE 1
#include <stdio.h> #include <stdio.h>
Line 1395: Line 1390:
#define REQUEST 0x65 #define REQUEST 0x65
#define REGISTER 0x10110 #define REGISTER 0x10110
-#define BTN_USB 0xB1000000 +#define BTN_NOTUSB 0x08000000
int main (int argc, char *argv[]) { int main (int argc, char *argv[]) {
Line 1410: Line 1405:
    if(ioctl(fd, REQUEST, &data) == 0) {     if(ioctl(fd, REQUEST, &data) == 0) {
-      if(data[1] == BTN_USB) {+      if(! ((data[1] & BTN_NOTUSB) == BTN_NOTUSB)) {
        printf("USB\n");         printf("USB\n");
        fflush(stdout);         fflush(stdout);
Line 1426: Line 1421:
The following script called in the /ffp/etc/fun_plug.local make the dns-320 reboot just by pressing on the usb button. The following script called in the /ffp/etc/fun_plug.local make the dns-320 reboot just by pressing on the usb button.
-The nohup is required because the shutdown.sh script kill processes but the one which have ppid 1 i think.+The redirection to /dev/null is required because the shutdown.sh script kill processes on some conditions.
<code> <code>
#!/bin/sh #!/bin/sh
 +
 +# /ffp/extra/shutdown/usbOff.sh
 +
 +export PATH=$PATH:/bin:/sbin
chkbutton | chkbutton |
Line 1437: Line 1436:
  then   then
    led usb blue blinking     led usb blue blinking
-    nohup /usr/sbin/shutdown.sh >/dev/null&amp;+    shutdown_ffp.sh >/dev/null 2&gt;/dev/null 
 +    exit 0
  fi   fi
done done
Line 1446: Line 1446:
# /ffp/etc/fun_plug.local # /ffp/etc/fun_plug.local
-PATH=$PATH:/ffp/bin+ 
 +# replacement for shutdown ; must not be on a mounted device 
 +cp /ffp/extra/shutdown/* /sbin
usbOff.sh& usbOff.sh&
</code> </code>
 +
 +The shutdown script is the same as the official one except that i've added a proper shutdown for ffp : /ffp/etc/rc stop
 +
 +<code>
 +#!/bin/sh
 +
 +# /ffp/extra/shutdown/shutdown_ffp.sh
 +
 +source /usr/local/modules/files/project_features
 +
 +/ffp/etc/rc stop
 +
 +kill_running_process
 +#kill -9 -1
 +
 +# remove link file
 +rm /usr/local/upload
 +sync
 +
 +umount_dev.sh all
 +
 +umount /usr/local/config
 +
 +sleep 1
 +# shutdown device
 +
 +MODEL=$(cat "/usr/local/modules/files/model")
 +echo "MODEL:$MODEL"
 +
 +if [ "$PROJECT_FEATURE_MCU_CHIP_WT693P" = "1" ]; then
 + echo "device shutdown"
 + up_send_ctl DeviceShutdown 0
 +
 +elif [ "$PROJECT_FEATURE_MCU_CHIP_69P803" = "1" ]; then
 + echo "send cmd to micro-p to shutdown"
 + up_send_ctl DeviceShutdown 1
 +else
 + poweroff
 +fi
 +</code>
 +

Navigation

Personal Tools