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 2008-05-15 09:05:42

maple
New member
From: Prague, Czech Republic
Registered: 2008-05-15
Posts: 3

Firmware upgrade failed, green led "death"

Hi gurus :-)

At first the story is: the samba sever was dropping the connection unexpectedly. When connected from win client, it was ok, when from Linux (Ubuntu), it was unusable - described here (http://ubuntuforums.org/showthread.php? … ht=dns+313).

As the firmware was 1.0, I decided to try upgrade - maybe it will help. Unfortunately, the upgrade failed and now the disk can't boot up, only green led is lighting. I have more than 400GB on that disk - of course, it is accessible via USB, but have no space, where to drop those data and load the system again with clickconnect and the format.

well, my questions are:

1) is there a possibility to load the system image on disk via USB? From Ubuntu, for example... without formatting the disk.
2) I read something similar regarding my samba issue here... http://dns323.kood.org/forum/t1321-drop … tion.html, nothing new?

Thanks a lot.

Offline

 

#2 2008-05-15 09:42:38

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: Firmware upgrade failed, green led "death"

Yes, itīs possible.

Take the file "system.tgz" from new firmware and put it in an folder on your linux PC.
Cut the imageheader away.   dd if=system.gz bs=8 skip=13 of=system_noh.gz
Unpack this:     tar -xzf system_noh.gz
You get 3 files, rootfs.tgz, rd.gz and zImage.
Connect the 313 over USB to your Linux-PC. Notice, as which device it is connected,
e.g. /dev/sda or /dev/sdb.
Mount the 3rd partition (ext2 filesystem). May be, if the filesystem on this partition is wrong, you can create a new.
mkfs.ext2 /dev/sda3 (or sdb3, sdc3...)
Mount this partition again.
Create a folder /.boot (donīt forget the dot before the "b"!)
Put the files  rootfs.tgz, rd.gz and zImage in this folder.
Unmount and disconnect the USB, connect network to the 313 and reboot.

Greatings,  the bear.


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#3 2008-05-15 20:57:24

maple
New member
From: Prague, Czech Republic
Registered: 2008-05-15
Posts: 3

Re: Firmware upgrade failed, green led "death"

Works like a charm!
Thank you very much for this detailed how to guide, I'm a Linux newbie and I have done it on a first attempt :-)

Regarding that samba - is there another way how to mount this NAS in Linux?

Offline

 

#4 2008-05-16 11:25:19

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: Firmware upgrade failed, green led "death"

maple wrote:

Works like a charm!
Thank you very much for this detailed how to guide, I'm a Linux newbie and I have done it on a first attempt :-)

Regarding that samba - is there another way how to mount this NAS in Linux?

mount //<ipaddr>/<share> /mnt/nas -o uid=<local_uid>,username=<nas_user_name>
you'll be prompted for a password then. if you want to mount the share at the boot time, check /etc/samba/smbfstab

uid option will help you to set the owner of a files to the local regular user.

in the official install there is no other protocol support, aside from ftp. but you can install the dropbear ssh server, and mount a directory using the sshfs.

Last edited by pcp (2008-05-16 11:29:38)

Offline

 

#5 2008-05-19 09:44:31

maple
New member
From: Prague, Czech Republic
Registered: 2008-05-15
Posts: 3

Re: Firmware upgrade failed, green led "death"

Thanks a lot. I played a bit and tried to extend my box with the fun_plug 0.5 and start the NFS, which is running now perfectly with my Ubuntu (automount).

Offline

 

#6 2008-05-19 23:08:19

radir
Member
Registered: 2008-01-03
Posts: 68

Re: Firmware upgrade failed, green led "death"

CharminBaer wrote:

Yes, itīs possible.

Take the file "system.tgz" from new firmware and put it in an folder on your linux PC.
Cut the imageheader away.   dd if=system.gz bs=8 skip=13 of=system_noh.gz
Unpack this:     tar -xzf system_noh.gz
You get 3 files, rootfs.tgz, rd.gz and zImage.
Connect the 313 over USB to your Linux-PC. Notice, as which device it is connected,
e.g. /dev/sda or /dev/sdb.
Mount the 3rd partition (ext2 filesystem). May be, if the filesystem on this partition is wrong, you can create a new.
mkfs.ext2 /dev/sda3 (or sdb3, sdc3...)
Mount this partition again.
Create a folder /.boot (donīt forget the dot before the "b"!)
Put the files  rootfs.tgz, rd.gz and zImage in this folder.
Unmount and disconnect the USB, connect network to the 313 and reboot.

Greatings,  the bear.

Stupid question: what format rd.gz and rootfs.tgz are??? Invalid magic and not gzip format error messages I got only ...

Thanks.

Offline

 

#7 2008-05-19 23:56:39

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: Firmware upgrade failed, green led "death"

radir wrote:

CharminBaer wrote:

Yes, itīs possible.

Cut the imageheader away.   dd if=system.gz bs=8 skip=13 of=system_noh.gz

Stupid question: what format rd.gz and rootfs.tgz are??? Invalid magic and not gzip format error messages I got only ...

Thanks.

there is a header containing some info for the bootloader. you must strip it off and then you can work with the file as with a regular gz archive.

Offline

 

#8 2008-05-20 00:22:03

radir
Member
Registered: 2008-01-03
Posts: 68

Re: Firmware upgrade failed, green led "death"

pcp wrote:

radir wrote:

CharminBaer wrote:

Yes, itīs possible.

Cut the imageheader away.   dd if=system.gz bs=8 skip=13 of=system_noh.gz

Stupid question: what format rd.gz and rootfs.tgz are??? Invalid magic and not gzip format error messages I got only ...

Thanks.

there is a header containing some info for the bootloader. you must strip it off and then you can work with the file as with a regular gz archive.

Ok, how? How long is this header?

Offline

 

#9 2008-05-20 10:05:03

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: Firmware upgrade failed, green led "death"

104 byte.

dd if=rd.gz bs=8 skip=13 of=rd_noh.gz ( 8*13=104 )

the rd.gz is an gzipped loop-filesystem, minix-fs, must mount on loop-device:

gunzip rd_noh.gz
mount -t minix -o loop rd_noh /mnt/...


the rootfs.tgz is a gzipped tar archive.

tar -xzf rootfs_noh.tgz (after stripping the header)

You can change both, but re-packing is a lot more difficult.
You need an 386-Linux, a tool from Dlink and an corresponding config-file for this.

Last edited by CharminBaer (2008-05-20 10:16:45)


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#10 2008-05-22 15:10:12

radir
Member
Registered: 2008-01-03
Posts: 68

Re: Firmware upgrade failed, green led "death"

CharminBaer wrote:

104 byte.
You can change both, but re-packing is a lot more difficult.
You need an 386-Linux, a tool from Dlink and an corresponding config-file for this.

That sounds mystical :-) So if I don't want to get overwritten everything (except user space /mnt/HD_a2) during boot time, other than getting that very special dlink tool+config file, there is no chance? Btw this tool is public or proprietary?

Offline

 

#11 2008-05-22 22:35:10

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: Firmware upgrade failed, green led "death"

Yes, the complete DNS-313-Firmware is a mystery...  lol
But not this tool. Itīs in the DNS-313 GPL sources, you can download from ftp.dlink.se:

ftp://ftp.dlink.se/Products/dns-product … 80128).tgz

(about 180MB!) file: mkimage in \DNS-313 GPL\Image\toolchain\bin  (binary for Linux/x86!)

If you only need this tool, better download from here:

http://www.msbd.de/image_tools.tgz

Syntax: ./mkimage -l ARCHIVE_WITH_HEADER (List header-info)
            ./mkimage -f CONFIGFILE -d INFILE OUTFILE  (makes FW-file / adding header)

cfg-file syntax:

MAGIC_NUMBER = 27051956
OS_TYPE = linux
#or: 4_4bsd, artos, dell, esix, freebsd, irix, lynxos, ncr, netbsd,
#    openbsd, psos, qnx, rtems, sco, solaris, svr-4, u-boot, vxworks
CPU_ARCH = arm
#or: alpha, x86, ia64, m68k, microblaze, mips, mips64, ppc, s390, sh, sparc, sparc64 
IMAGE_TYPE = kernel
#or: filesystem, firmware, multi, ramdisk, script, standalone, uboot
COMPRESS_TYPE = gzip
#or: none, bzip2
DATALOAD_ADDRESS = 0x00008000
ENTRY_ADDRESS = 0x00008000
IMAGE_NAME kernel.img
MODEL_NAME = DNS-313
MAC_ADDRESS = 00:80:c8:16:81:68
# je nach Version
VERSION = 1.01b12
#START_OFFSET
#END_OFFSET
#OVERWRITE

ChBear

Last edited by CharminBaer (2008-05-22 22:39:42)


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#12 2008-05-23 12:40:07

radir
Member
Registered: 2008-01-03
Posts: 68

Re: Firmware upgrade failed, green led "death"

mkimage tool will create system.gz including 3 items rd.gz, zImage, rootfs.tgz; or can i (de)pack any of the 3 components indiviudally?

Did you change rd.gz not to overwrite everything?

Thank you very much.

Offline

 

#13 2008-05-23 13:21:45

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: Firmware upgrade failed, green led "death"

Itīs very simple:

Take the rd.gz from /.boot-directory, unpack it as described below.
Look after the file "linuxrc" (in / of the initial ramdisk, but not the linucrc~, these is not needed)
This script deletes the complete root-filesystem on every reboot! Make changes at your own wishes.
Then unmount the rd_noh-file, pack it again with gzip and add the header:

./mkimage -f kernel.cfg -d rd_noh.gz rd.gz

(I think, no matter whether taking kernel.cfg or ramdisk.cfg)

and put this rd.gz back to the /.boot-directory...

Creating a complete firmware-image, you need all the 3 files from .boot-dir. Put they into a gzipped tar archive:

tar czf system_noh.tgz rd.gz rootfs.tgz zImage

and add the header:

./mkimage -f kernel.cfg -d system_noh.tgz system.tgz

Last edited by CharminBaer (2008-05-23 13:22:57)


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#14 2008-05-27 01:28:04

radir
Member
Registered: 2008-01-03
Posts: 68

Re: Firmware upgrade failed, green led "death"

Thanks, I will try. If I am going to play with linuxrc anyway, any suggestion what else, other than samba, can cause continuous reading/writing to hdd prohibiting standby?

Offline

 

#15 2008-05-27 10:52:15

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: Firmware upgrade failed, green led "death"

It is definitely the smb-daemon, produces permanently some output in his logfile.
Put these entries in the [global] section of smb.conf:

   domain master = no
   local master = no
   preferred master = no
   os level = 0


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#16 2008-05-27 14:36:46

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: Firmware upgrade failed, green led "death"

[global]
log level = 0

syslog is writing logs too, cron daemon is accessing disk frequently, as well the atd. you need to kill all of them to put the disk into the sleep state.

Offline

 

#17 2008-05-28 00:13:12

radir
Member
Registered: 2008-01-03
Posts: 68

Re: Firmware upgrade failed, green led "death"

CharminBaer wrote:

file: mkimage in \DNS-313 GPL\Image\toolchain\bin  (binary for Linux/x86!)

If you only need this tool, better download from here:

http://www.msbd.de/image_tools.tgz

Syntax: ./mkimage -l ARCHIVE_WITH_HEADER (List header-info)
            ./mkimage -f CONFIGFILE -d INFILE OUTFILE  (makes FW-file / adding header)

I have the GPL source file, but neither Image\toolchain\bin\mkimage nor the version from the URL can be executed. I am using Ubuntu x64. Though the file exists I receive "No such file error" when try to start it. Is it because of 64bit linux???

By the way unpacking works :-) Thanks for guide.

Offline

 

#18 2008-05-28 09:06:44

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: Firmware upgrade failed, green led "death"

Try "apt-get install ia32-libs" before...


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#19 2008-06-01 22:40:32

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: Firmware upgrade failed, green led "death"

@radir

Success?


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#20 2008-06-02 17:42:48

radir
Member
Registered: 2008-01-03
Posts: 68

Re: Firmware upgrade failed, green led "death"

CharminBaer wrote:

@radir

Success?

Sorry, i was net-less ...

Yes, thank you very much everything worked fine!

Now my root partition is not cleaned everytime.
Though one more question pls: do I need to add/remove header for kernel as well? I compiled a kernel but it does not start with, was wondering if it is because kernel is bad (not for this CPU or something); or because not used header?

Offline

 

#21 2008-06-02 20:43:46

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: Firmware upgrade failed, green led "death"

Exactly this is the reason why....


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#22 2008-06-03 22:11:28

radir
Member
Registered: 2008-01-03
Posts: 68

Re: Firmware upgrade failed, green led "death"

CharminBaer wrote:

Exactly this is the reason why....

Just to clarify: need to add header to zImage too, right? As my compiled kernel does not start neither with nor without header ...
May I ask you to please send me/upload your kernel config file, if you used a customized kernel for your etch package?

Last edited by radir (2008-06-03 22:20:35)

Offline

 

#23 2008-06-03 23:23:33

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: Firmware upgrade failed, green led "death"

I think (but not absolutely sure..) the bootloader compares headers of rd.gz, rootfs.tgz and zImage and strikes, when they not identical. Especially the MAGIC_NUMBER and the VERSION. So you should find out the values of the other files by using "mkimage -l ..." and put exactly these values in your config-file. (Syntax of configfile I described above...)


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#24 2008-06-04 23:22:30

radir
Member
Registered: 2008-01-03
Posts: 68

Re: Firmware upgrade failed, green led "death"

I checked: you were right, all 3 files using header. But still no luck with customized kernel :-( Keep trying ...

Offline

 

#25 2009-02-21 22:16:10

steffen
Member
Registered: 2008-03-09
Posts: 42

Re: Firmware upgrade failed, green led "death"

sooo, is it possible to to this via windows / os x? :>

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB