cd /mnt/<fs> # where <fs> can be sda2, sda4, md0,... it depends on your disk setup. To be used also in the next steps
echo -n "636c7cbec3cc770cf6fda3722dc17af6 dns320l.tar.gz" > dns320l.tar.gz.md5 # generate md5sum to verify download
wget -O dns320l.tar.gz https://groups.google.com/group/alt-f/attach/68d2937564df0add/dns320l.tar.gz?part=0.1md5sum -c dns320l.tar.gz.md5 # must display "dns320l.tar.gz: OK"
mkdir dns320l-fixes
tar -C dns320l-fixes -xzf dns320l.tar.gz
#!/bin/sh
# User script to be executed at boot time when the disk partition is detected and mounted# UNTESTED, be sure you know what you are doing!
FIXDIR=/mnt/<fs>/dns320l-fixes # change <fs> for the same filesystem name you used in the previous step
case "$1" in start) board=$(cat /tmp/board) if test "$board" != "DNS-320L-A1"; then exit 0; fi # this is only for the DNS-320L
# create power_led sys folder. Expect that files there will be created as needed. mkdir -p /tmp/sys/power_led
# copy new sysctrl to /usr/sbin rcsysctrl stop cp $FIXDIR/sysctrl /usr/sbin rcsysctrl start
# disable init from launching dns320-daemon, and terminate it sed -i 's/\(.*dns320l-daemon.*\)/#\1/' /etc/inittab kill -1 1 killall dns320l-daemon cp $FIXDIR/dns320l-daemon /usr/sbin
# allow init to launch the dns320-daemon sed -i 's/^[#]*[[:space:]]*\(.*dns320l-daemon.*\)/\1/' /etc/inittab kill -1 1
# incorrect time at startup, update settings saved time adjtime -restart touch /tmp/settings_saved
# turn off USB led if ! grep -q 'usb.*=' /etc/bay; then echo 0 > /tmp/sys/usb2_led/brightness fi
# make the poweroff command (and the webUI) shutdown the box # use <TAB> characters, not spaces, in the EOF section bellow, or just remove all indenting rm -f /sbin/poweroff cat<<-EOF > /sbin/poweroff #!/bin/sh nohup rcall stop & dns320l-daemon -x DeviceShutdown busybox poweroff EOF chmod +x /sbin/poweroff
# power up the box after a power fail/recovery cycle dns320l-daemon -x EnablePowerRecovery
;;
stop) : ;;
*) echo "$0 start|stop" ;;esac
chmod +x /mnt/<fs>/dns320l.sh # replace <fs> with the filesystem used
/mnt/<fs>/dns320l.sh start # replace <fs> with the filesystem used
dns320l-daemon -x DeviceShutdown # powers-off the box within 15 seconds. Be sure that filesystems are unmounted!
poweroff # depending on your system setup, this will hopefully perform a clean shutdown within the 15 seconds scheduled poweroff
Hi,The Alt-F released firmware for the DNS-320L has same flaws, mainly because I didn't have one to try with.Now that I have one, donated by Andreas Marsch, better support will be available, but it will take some time, as I'm not a fast runner.With the help of several persistent users, namely Ronaldo Antoni, Henrik Bruening, Steven Samson and others, some issues have been corrected and fixes made available.As the most productive topic (REPORTING STUFF: D-Link DNS 320L rev A3) has over 63 posts, I summarize here how to apply the fixes.1-You have to download the dns320l.tar.gz file and extract it to disk using the following commands:
cd /mnt/<fs> # where <fs> can be sda2, sda4, md0,... it depends on your disk setup. To be used also in the next steps
wget -O dns320l.tar.gz https://groups.google.com/group/alt-f/attach/68d2937564df0add/dns320l.tar.gz?part=0.1
mkdir dns320l-fixes
tar -C dns320l-fixes -xzf dns320l.tar.gz
2-You have then to download a script to execute at boot time and save it on the base of a filesystem root, such as /mnt/sda2/dns320l.sh.An alternative slightly modified script that's easier to edit (don't use MS-Win editors to edit it, or use only unix-compatible editors):
#!/bin/sh
# User script to be executed at boot time when the disk partition is detected and mounted
# UNTESTED, be sure you know what you are doing!
FIXDIR=/mnt/<fs>/dns320l-fixes # change <fs> for the same filesystem name you used in the previous step
case "$1" in
start)
board=$(cat /tmp/board)
if test "$board" != "DNS-320L-A1"; then exit 0; fi # this is only for the DNS-320L
# create power_led sys folder. Expect that files there will be created as needed.
mkdir -p /tmp/sys/power_led
# copy new sysctrl to /usr/sbin
rcsysctrl stop
cp $FIXDIR/sysctrl /usr/sbin
rcsysctrl start
# disable init from launching dns320-daemon, and terminate it
sed -i 's/\(.*dns320l-daemon.*\)/#\1/' /etc/inittab
kill -1 1
killall dns320l-daemon
cp $FIXDIR/dns320l-daemon /usr/sbin
# allow init to launch the dns320-daemon
sed -i 's/^[#]*[[:space:]]*\(.*dns320l-daemon.*\)/\1/' /etc/inittab
kill -1 1
;;
stop) : ;;
*) usage $0 "start|stop" ;;
esac
3-You then have to make the script executable by using the command
chmod +x /mnt/<fs>/dns320l.sh # replace <fs> with the filesystem used4-You can test the script by executing the command
/mnt/<fs>/dns320l.sh start # replace <fs> with the filesystem used
5-If it works OK (watch the Status page and the System Log), you must activate the script using the webUI, going to Services->User, user, Configure, and fill in the "Script to execute on powerup:" entry with /mnt/<fs>/dns320l.sh, where again <fs> must be replaced6-You now have to "save settings", System->Settings, Save Settings7-To fully test it you have to reboot.
As you know, the box can't (yet) be powered-off using commands, you have to pull the power cord. The following command enables doing that:
dns320l-daemon -x DeviceShutdown # powers-off the box within 15 seconds. Be sure that filesystems are unmounted!
poweroff # depending on your system setup, this will hopefully perform a clean shutdown within the 15 seconds scheduled poweroff
This is truly amazing João. I really thank you and all people that supported it.
May i ask, when you fully identify the 320l's peculiarities and implement the necessary changes/fixes, will it be uploaded as a "RC5"?
As you know, the box can't (yet) be powered-off using commands, you have to pull the power cord.
The following command enables doing that, but to be sure that the 15 seconds time window are enough to perform a clean shutdown, stop all services using the webUI (System->Utilities), before issuing the commands:
dns320l-daemon -x DeviceShutdown # powers-off the box within 15 seconds. Be sure that filesystems are unmounted!
poweroff # depending on your system setup, this will hopefully perform a clean shutdown within the 15 seconds scheduled poweroff
#!/bin/sh
nohup rcall stop &
dns320l-daemon -x DeviceShutdown
busybox poweroff
chmod +x /mnt/<fs>/dns320l-fixes/poweroff
/mnt/<fs>/dns320l-fixes/poweroff
Many thanks, Regards, Kjeld
Great. I was not aware of the tread. Am a noob with the Google Groups, but it seems the issues have been solved.
Great. I was not aware of the tread. Am a noob with the Google Groups, but it seems the issues have been solved.You mentioned you will compile a RC4.01 for the 320L in September with all the collected fixes. Is that just around to be released - should I wait a few more days, or should i go for the RC4 and patch that one instaed?
Hi,I wanted report back since I'm running Alt-F 0.1RC4 on my DNS-320L Rev. A1.My journey was going from stock dlink to fun_plug on usb drive to debian squeeze on usb drive finally to Alt-F. I have been following the development for quite some time and was pleased to read that the DNS-320L is now supported.After adding a second drive a few days ago, i noticed that the system was acting up in terms of not being reachable via ssh and so on. Thats when i decided to try Alt-F.I flashed the firmware file and followed all the instructions (package update, fixes, dns320l fixes). I then configured the samba, afp shares, time machine, transmission, nzbget the way i wanted it and was very pleased to have a working system. I also had a degraded raid 1 swap space which i corrected according to the instructions in another thread.
[root@dns325]# mdadm --examine --scan --verboseARRAY /dev/md0 level=raid1 num-devices=2 UUID=82ab3294:52362cfa:99e4564d:3c32c8b1devices=/dev/sdb1,/dev/sda1ARRAY /dev/md1 level=raid1 num-devices=2 UUID=3e9d6bcf:d62e060a:46f5bc7e:d7015fdedevices=/dev/sdb2,/dev/sda2ARRAY /dev/md2 level=linear num-devices=2 UUID=9b9bb7a7:a23714f3:e53a7f69:4368ce15devices=/dev/sdb3,/dev/sdb,/dev/sda3,/dev/sda
fyi: I have changed the stock fan with a 12v noctua fan, because noise of the stock fan drove me nuts. Alt-F seems to handle it quite well, since the fan can now go from off to low to high, which didn't work in the stock firmware from what i recall. i had to leave it on the setting low or high because the fan would not spin up from off state.One thing i noticed is that it takes a quite i while until i can see the shares when connecting via afp. When i click on the nas icon in finder it takes about 10 seconds until i can see the folders (this was faster with stock firmware).
This is just a tiny little thing and absolutely no problem, because then it is faster than stock. But i will check if i can find something in the OSX console and report back.I am impressed how easy it was to set everything up. I usually like to edit config files manually, but it was very comfortable working with the webui and i think that is very handy for someone who doesn't really enjoy working in a terminal window.From a users perspective i have all i currently want from my nas. Thank you very much for your work. I will try to report back and give feedback on stuff i come across.
I'm doing some tests on the donated DNS320L that I now have (thanks Andreas), and found another D-Link idiosyncrasy: JBOD (linear "RAID") is setup on the disk MBR!!! (yes, !!!).Using D-Link 1.04b fw I setup a RAID1 using only part of the disk space and the remaining space as JBOD, and this is the result:[root@dns325]# mdadm --examine --scan --verboseARRAY /dev/md0 level=raid1 num-devices=2 UUID=82ab3294:52362cfa:99e4564d:3c32c8b1devices=/dev/sdb1,/dev/sda1ARRAY /dev/md1 level=raid1 num-devices=2 UUID=3e9d6bcf:d62e060a:46f5bc7e:d7015fdedevices=/dev/sdb2,/dev/sda2ARRAY /dev/md2 level=linear num-devices=2 UUID=9b9bb7a7:a23714f3:e53a7f69:4368ce15devices=/dev/sdb3,/dev/sdb,/dev/sda3,/dev/sdaSo, there are two issues with 1.04b08:1-swap devices over a RAID1 (if at least it was RAID0...) -- what a waste of resources!
2-metadata for JBOD on the device disk (not on a device partition)Although it is OK to have RAID on whole disks, mixing device disks and device partitions on a RAID is notWARNING: So, if you have a similar RAID configuration, Alt-F will not be able to auto-assemble *any* RAID devices.
One thing i noticed is that it takes a quite i while until i can see the shares when connecting via afp. When i click on the nas icon in finder it takes about 10 seconds until i can see the folders (this was faster with stock firmware).I think that this should be related with the strong encryption required by afp.For flash memory space reasons (for the DNS-323, which is the base reference) hardware cryptographic support is not built in the kernel, while for the DLink firmware it is. You might be able to fix this by installing the kernel-modules package and loading the mv_cesa (and possibly also the crypto_hash and/or cryptodev) kernel module.If you try please let us know the outcome.
gathered my courage and tested the changes...when i try to test the dns320l.sh it gives me a "not found" message, even if it's on the right placeGot a linux-oriented soul to mess with it and now i get /mnt/sda2/dns320l.sh: line 54: syntax error: unexpected end of file (expecting ";;")
cat<<-EOF > /sbin/poweroff
" in /mnt/sda2/dns320l.sh wrecks the system because /sbin/poweroff is a symlink to the busybox binary, which is the actual file that gets overwritten. Need to delete the symlink first.
# make the poweroff command (and the webUI) shutdown the box# use <TAB> characters, not spaces, in the EOF section bellow, or just remove all indenting
cat<<-EOF > /sbin/poweroff
#!/bin/shnohup rcall stop &dns320l-daemon -x DeviceShutdownbusybox poweroff
EOFchmod +x /sbin/poweroff
The "cat<<-EOF > /sbin/poweroff
" in /mnt/sda2/dns320l.sh wrecks the system because/sbin/poweroff is a symlink to the busybox binary, which is the actual file that gets overwritten. Need to delete the symlink first.
Dec 9 20:24:22 DNS320L daemon.info sysctrl: signaled to quit, quiting Dec 9 20:24:22 DNS320L daemon.info sysctrl: Starting Dec 9 20:24:22 DNS320L daemon.info sysctrl: reading /etc/bay Dec 9 20:24:22 DNS320L daemon.info sysctrl: reading /etc/misc.conf Dec 9 20:24:22 DNS320L daemon.info sysctrl: reading /etc/sysctrl.conf Dec 9 20:24:22 DNS320L daemon.info sysctrl: can't open /etc/sysctrl.conf: No such file or directory Using defaults Dec 9 20:24:22 DNS320L daemon.info sysctrl: args.lo_fan=2000 Dec 9 20:24:22 DNS320L daemon.info sysctrl: args.hi_fan=5000 Dec 9 20:24:22 DNS320L daemon.info sysctrl: args.lo_temp=45 Dec 9 20:24:22 DNS320L daemon.info sysctrl: args.hi_temp=50
Hi Joao,
I installed successfuly ALT-f firmware in my DNS320L-A3.
Then follow the steps to install the dns320l.sh fixes.It runs correctly and finish OK, but in system log appears an error message:Dec 9 20:24:22 DNS320L daemon.info sysctrl: signaled to quit, quiting Dec 9 20:24:22 DNS320L daemon.info sysctrl: Starting Dec 9 20:24:22 DNS320L daemon.info sysctrl: reading /etc/bay Dec 9 20:24:22 DNS320L daemon.info sysctrl: reading /etc/misc.conf Dec 9 20:24:22 DNS320L daemon.info sysctrl: reading /etc/sysctrl.conf Dec 9 20:24:22 DNS320L daemon.info sysctrl:can't open /etc/sysctrl.conf: No such file or directory Using defaults
Dec 9 20:24:22 DNS320L daemon.info sysctrl: args.lo_fan=2000 Dec 9 20:24:22 DNS320L daemon.info sysctrl: args.hi_fan=5000 Dec 9 20:24:22 DNS320L daemon.info sysctrl: args.lo_temp=45 Dec 9 20:24:22 DNS320L daemon.info sysctrl: args.hi_temp=50I go to /etc directoryand the file that exists is sysctl.conf not sysctrl.confAnother thing is that de usb, right and left disk leds stays in orange permanently, ¿is that correct?.