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-04-25 23:01:19

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

image of the system partition/boot

Hello,
i'm trying to install the device, but the ClickNConnect crashes all the time, with wine and with a cedega, and even on windows. May I ask somebody to do the image of the system partitions with a dd, gzip it, and post it somewhere? I offer one million internets for person who do that.
thanks

Offline

 

#2 2008-04-26 16:14:52

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

Re: image of the system partition/boot

ok, i made the install without the d-link crappy installer. it was done by some gory packet replays and traffic sniff, but now i have the dns-313 with funplug ready

things which i want to do next:
- change the filesystem to anything else than NTFS (NO I DONT WANT)
- check the function of an internal usb OTG device. it should be possible to use it in many interesting ways, unfortunately the  backing file module fails to load and crashes on malloc error
- i want ssh, ASAP
- there are two mtdblock devices, which contains few config files. they might contain something useful
- new kernel with xfs/ext3 and acl support
- o shit! fan scripts are failing with IOCTL error...ayyeeww!

i will make a tutorial how to install this..thing from linux, but i am bit of busy right now.

Offline

 

#3 2008-05-04 23:24:53

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

Re: image of the system partition/boot

Hi, pcp,

in the last weeks I explored the complete boot-process of the DNS-313 and internal structure of firmware-files. (let´s snip the first 104 byte and get a gzipped tar-archive, containing 3 files, having the same 104byte image-header...)
But I think,  by now you also have these knowledges...

Greatings Bear


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

Offline

 

#4 2008-05-04 23:46:36

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

Re: image of the system partition/boot

o, rly? i thought it would be more difficult to unpack them.
now i am wondering if it is possible to do a fresh install of a 313, simply by partitioning and formatting the drive to the schema the dns313 uses, and then simply copying these three files (rd.gz, zImage, and system.gz) to the /.boot/ directory at the /dev/sda2 partition.

Offline

 

#5 2008-05-08 11:18:13

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

Re: image of the system partition/boot

Yes, it works. But the /.boot/ directory is on the 3rd partition, at /dev/sda3. And not system.gz but  rootfs.tgz must be there. If you made changes in rd.gz´s linuxrc-script to not erase the complete sda3 every boot time, the rootfs.tgz isn`t really necessary, mine is empty and it goes...

Are there some people who want to adding a serial console to their DNS-313? Helpful in trying out some different firmwares. Next days i will make some pictures from the PCB and a little tutorial for this.


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

Offline

 

#6 2008-05-08 13:24:15

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

Re: image of the system partition/boot

CharminBaer wrote:

Yes, it works. But the /.boot/ directory is on the 3rd partition, at /dev/sda3. And not system.gz but  rootfs.tgz must be there. If you made changes in rd.gz´s linuxrc-script to not erase the complete sda3 every boot time, the rootfs.tgz isn`t really necessary, mine is empty and it goes...

Good to know, hope it will help more people with troubles with default installer.

Are there some people who want to adding a serial console to their DNS-313? Helpful in trying out some different firmwares. Next days i will make some pictures from the PCB and a little tutorial for this.

Yes, i want to build one. Tutorial would be great..at least the PCB serial port pinout and a schema for the rs232 converter.

Offline

 

#7 2008-05-08 23:06:05

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

Re: image of the system partition/boot


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

Offline

 

#8 2008-05-10 00:39:31

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

Re: image of the system partition/boot

CharminBaer wrote:

Yes, it works. But the /.boot/ directory is on the 3rd partition, at /dev/sda3. And not system.gz but  rootfs.tgz must be there. If you made changes in rd.gz´s linuxrc-script to not erase the complete sda3 every boot time, the rootfs.tgz isn`t really necessary, mine is empty and it goes...

Are there some people who want to adding a serial console to their DNS-313? Helpful in trying out some different firmwares. Next days i will make some pictures from the PCB and a little tutorial for this.

It seems you are very well understanding how the file system is built-up and the boot sequence. Would it be possible to write a detailed how-to please? I can run etch, compile apps but for example still not found what prevents DNS enter to standby mode ... Maybe if I could control better DNS with your help (eg. new kernel with a smarter boot sequence (not delete sda3 all the time)), would have a working system and would do finally what D-link promised ...

Thanks in advance.

Offline

 

#9 2008-05-10 01:49:09

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

Re: image of the system partition/boot

radir wrote:

It seems you are very well understanding how the file system is built-up and the boot sequence. Would it be possible to write a detailed how-to please? I can run etch, compile apps but for example still not found what prevents DNS enter to standby mode ... Maybe if I could control better DNS with your help (eg. new kernel with a smarter boot sequence (not delete sda3 all the time)), would have a working system and would do finally what D-link promised ...

Thanks in advance.

d-link system is a pile of junk. the sooner we make a new firmware for dns-313, the better world will arise for the whole mankind.

Last edited by pcp (2008-05-10 01:49:23)

Offline

 

#10 2008-05-19 23:19:51

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

Re: image of the system partition/boot

You are right - unfortunately 313 firmware is really sucks. My main problems are (at this moment):
- no standby - something always writes/reads from/to disk no matter that no 'customer' activity is done. For example samba write a log file with 'global_sam_sid is not null' entries. I would like to remove it. Any such logging I would switch off.
- firmware is stupid. A new one with new kernel without stupid rd.gz. By the way what format it is, I cannot extract it receiving error messages only.

Luckily other problems are solved: reliable, fast(er) ext2 is my file system, torrent client is running ... so at least these are working now.

Regards.

Offline

 

#11 2008-05-20 09:48:27

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

Re: image of the system partition/boot

Then let´s do it! My new version of instant-to-use Etch for the 313 is nearly finished. I think, I can provide it for download this week. Of course with a little tutorial. My new rd.gz is not so stupid, does almost nothing at boot time than pivot-root...
But the kernel is still a problem. Seems, this is more pcp´s part in this play  ;o) Ey, we wanna use
ext3, at least at the data-partition! I think, ext3 on root-partition will not work due to the SL-bootloader. But this thing is better untouched to beware bricking...

ChBear.

p.s. the standby-problem and the 'global_sam_sid-entries' can prevent wit these entries in the [global] section of smb.conf:

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

and eventually (prevents "Unable to open printcap file /etc/printcap for read"-entries)

   load printers = no
   printcap name = /dev/null
   printing = bsd
   log level = 0


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

Offline

 

#12 2008-05-20 10:20:27

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

Re: image of the system partition/boot

Try this one. It has ext3 support compiled in. USB is unfortunately still not working in a host mode sad
The gemini power driver also has some changes - it doesn't send the signal to the control utility, but uses irq wait to handle button press. Unfortunately, it still works for the first keypress, dunno why. Oh, and you will need a new script-exec utility for this.

Offline

 

#13 2008-05-20 10:25:13

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

Re: image of the system partition/boot

pcp wrote:

Try this one. It has ext3 support compiled in. USB is unfortunately still not working in a host mode sad
The gemini power driver also has some changes - it doesn't send the signal to the control utility, but uses irq wait to handle button press. Unfortunately, it still works for the first keypress, dunno why. Oh, and you will need a new script-exec utility for this.

It seems the forum has strict limitation for attachment. Download the image : http://popcorp.org/data/zImage
And the pbutton utility : http://popcorp.org/data/pbutton.tbz2

Offline

 

#14 2008-05-20 12:56:44

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

Re: image of the system partition/boot

Thanks for this...

The ext3 works fine, but now the powerbutton (ng) does nothing...    :-(

The log says "Power event by Button..." but nothing else happens...

Last edited by CharminBaer (2008-05-20 13:23:16)


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

Offline

 

#15 2008-05-20 15:42:51

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

Re: image of the system partition/boot

i'll check it this evening..i did some experiments in the kernel source, so it might be my fault smile

Offline

 

#16 2008-06-05 22:58:42

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

Re: image of the system partition/boot

pcp wrote:

Try this one. It has ext3 support compiled in. USB is unfortunately still not working in a host mode sad
The gemini power driver also has some changes - it doesn't send the signal to the control utility, but uses irq wait to handle button press. Unfortunately, it still works for the first keypress, dunno why. Oh, and you will need a new script-exec utility for this.

Hi,

May I ask some guide how you compiled kernel?
What I did was:
- download 2.6.25 kernel source
- on DNS with chroot-ed etch compiled a new kernel (can you upload your kernel config pls?)
- add DNS-header and put zImage to /.boot along with the compiled modules (into /lib)

But it does not work ...

Any idea?

Thanks.

Offline

 

#17 2008-06-05 23:16:38

naffarin
Member
Registered: 2008-01-28
Posts: 47

Re: image of the system partition/boot

The original D-Link Kernel is based on a patch from Storlink for kernel 2.6.15 which is not integrated into the linux kernel mainline. So if you download any official kernel it does not support the mainboard of the dns 313.

I found https://openwrtstorlink.svn.sourceforge.net/ on the net containing a more current kernel version but didn't compile or try it it out yet but it may be worth a try.

Offline

 

#18 2008-06-06 00:19:00

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

Re: image of the system partition/boot

Hi Naffarin,

Thanks for info. Will take a look.

Pcp,
Did you compile your zImage from the public kernel source?

Last edited by radir (2008-06-06 00:23:21)

Offline

 

#19 2008-06-08 22:14:44

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

Re: image of the system partition/boot

The reason why I would like to build a new kernel - so far unsuccessfully none of my compiled kernel is working :-( - is the following:
1. enable NFS
2. add additional language support
3. enable filesystems other then ext2/ntfs.

I did some testings regarding filesystems, the process was:
1. mount file system (into my Ubuntu x64 PC) [DNS was connected via USB]
2. copy a tar.gz to new fs (61,517,918B/58.67MB)
3. delete tar.gz
4. untar tar.gz from my PC to DNS
5. delete all files on DNS
6. umount
7. initial disk usage after format
8. disk usage after untar (#4)
Sync was used between all steps.

                 ext2             ext3              jfs           reiserfs    xfs             min
1. mount    0.035    0.013    0.014    1.477    0.027    0.013
2. copy    0.536    0.581    0.151    0.164    0.086    0.086
3. delete    0.029    0.036    0.003    0.026    0.015    0.003
4. untar    6.337    16.959    22.731    4.915    21.250    4.915
5. delete    0.290    0.546    9.047    0.838    7.060    0.290
6. umount    0.020    0.017    0.037    0.022    0.066    0.017
7. init disk usage (MB)    2.3    11    0.19    33    4.3    0.191
8. disk usage (MB)    275    283    327    317    321    275
                       
uncompressed tar 284,651,520    271.46MB                   
tar.gz 61,517,918    58.67MB                   

Quite interesting results ...

Offline

 

#20 2008-06-10 21:27:55

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

Re: image of the system partition/boot

Hey, Pcp, are you around? We need you!

How could you compile a working kernel for instance? I've tried many ways but no success at all ... Teach me, Master, plz plz plz!

Offline

 

#21 2008-06-10 22:55:14

naffarin
Member
Registered: 2008-01-28
Posts: 47

Re: image of the system partition/boot

You can always use the kernel from the dlinks toolchain.  You have to patch some syntax bugs in the source but otherwise it compiles fine.
I am using this patchfile, although it doesn't really fix a bug in the usb files...doesn't hurt though because the usb controller is not active anyway:

--- linux.org/drivers/char/sl2312_wd.c    2007-08-03 07:45:28.000000000 +0200
+++ linux-2.6.15/drivers/char/sl2312_wd.c    2008-04-12 18:52:59.000000000 +0200
@@ -60,11 +60,11 @@

struct file_operations watchdog_fops = {
     .owner= THIS_MODULE,
-    .write watchdog_write,
+    .write= watchdog_write,
     .read= watchdog_read,
     .open= watchdog_open,
     .release= watchdog_release,
-    .ioctl= watchdog_ioctl,
+    .ioctl= watchdog_ioctl
};

static int watchdog_open(struct inode *inode, struct file *filp)
--- linux.org/drivers/serial/serial_sl2312.c    2007-08-03 07:47:14.000000000 +0200
+++ linux-2.6.15/drivers/serial/serial_sl2312.c    2008-04-12 19:30:18.000000000 +0200
@@ -766,7 +766,7 @@
    return uart_set_options(port, co, baud, parity, bits, flow);
}

-extern struct uart_driver sl2312_reg;
+static struct uart_driver sl2312_reg;
static struct console sl2312_console = {
    .name      = SERIAL_SL2312_NAME,
    .write        = sl2312_console_write,
--- linux.org/drivers/usb/gadget/FTC_FOTG200_udc_1.c    2006-09-27 09:32:12.000000000 +0200
+++ linux-2.6.15/drivers/usb/gadget/FTC_FOTG200_udc_1.c    2008-04-12 18:53:48.000000000 +0200
@@ -195,7 +195,7 @@

   //<2>.Set the ep data
    /* enabling the no-toggle interrupt mode would need an api hook */
-    max = le16_to_cpu(get_unaligned(&desc->wMaxPacketSize));
+          // only to make it compile, no real fix
+    max = le16_to_cpu(desc->wMaxPacketSize);
    printk("###### max %x\n",max);

    // In FOTG200 Only support DMA (PIO not support)

Offline

 

#22 2008-06-10 23:10:11

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

Re: image of the system partition/boot

Hey, radir, take it easy...

There are  2 ways to get an well working new kernel:

1. Tell me (or us) the features you need and we will do our very best... After many unsuccessfull tries making a kernel is no more a problem for me.

2. Follow simply these steps:
       - You need a well-configured i386-linux, at best an Debian Etch or Ubuntu, SuSE also should do this job.
       - Packages you need: libncourses-devel (for make menuconfig)
       - The D-Link DNS-313 GPL-sources, I think, you have they already downloaded.
       - Unpack the Sources in an folder as you like, inside you will find an archive named "dns313_src.tgz"
       - Unpack this archive in an folder as you like, these are the real GPL-Sources.
       - Inside you should find an folder "opt", copy or move the content of this folder into your /opt directory. This is the engine for
           compiling your new kernel, the cross-compiler and many other tools.
       - go to the folder, where you unpacked the sources, containing the folders "opt", "Image" and "module".
       - type "cd Image" at commandline.
       - type "source source.me" (Produces some output, but don´t should say "error" or so...)
       - type "cd src/linux"
       - type "make menuconfig" (When you can see the menu now, you´re on the right way...)
       - play around with the options, but the first run of compiling a kernel is better without any changes.
       - Leave the menuconfig, type simply "make". Thats really enough to making a new kernel!
       - DONT WONDER ABOUT THE MANY, MANY WARNINGS! As pcp said, the D-LINK-code is crappy...
       - When all done without errors, you can find the new baken kernel in the directory Image/src/kernel.

ChBaer.


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

Offline

 

#23 2008-06-10 23:31:38

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

Re: image of the system partition/boot

naffarin wrote:

You can always use the kernel from the dlinks toolchain.  You have to patch some syntax bugs in the source but otherwise it compiles fine.

Hi,

I tried that too: used the toolchain's kernel source. Compilation is ok, at the end I got a zImage and modules.

But. Whenever I add the header (mkimage -f kernel.cfg ...) and copy the new kernel over, my box does not start. Leds are on in blue but nothing happens, and it is not accessible via LAN. Also I recognized that when I clear(=delete) everything from system partition and put back the original kernel, rd.gz, rootfs.tgz it seems that box is hesitating a little, then continues boot process: runs rd.gz, re-extract rootfs (after deleting everything :-/) etc etc. Finally my box is alive and can be accessed.

So my questions would be:
1. the previous patch is the only thing required to build kernel?
2. Is this the right process to build the kernel:
a) set development environment to use arm-le...-gcc via source.me
b) make, make modules and make modules_install
c) /arch/arm/boot/zImage is the new kernel; and - by default - /lib/modules/2.6.15 will contain all the modules; and System.map will contain all the entry points
d) mkimage -f kernel.cfg -d zImage h_zImage
e) mv h_zImage <dns_system>/.boot/zImage and cp System.map <dns_system>/.boot and cp -r /lib/modules/2.6.15/* <dns_system>/lib/modules/2.6.15
3. can somebody confirm whether the flash bootloder needs to be updated somehow to introduce the new kernel, for example in flash might store hash code of kernel so it is no enough to overwrite it in /.boot ?
4. I saw a kernel from Pcp, Naffarin (or anybody else) were you too able to compile and use a customized kernel?

In short: I need some guide as it seems I am doing something wrong :-(

Thanks.

Offline

 

#24 2008-06-10 23:39:02

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

Re: image of the system partition/boot

CharminBaer wrote:

Hey, radir, take it easy...

There are  2 ways to get an well working new kernel:

1. Tell me (or us) the features you need and we will do our very best... After many unsuccessfull tries making a kernel is no more a problem for me.

2. Follow simply these steps:
       - You need a well-configured i386-linux, at best an Debian Etch or Ubuntu, SuSE also should do this job.
       - Packages you need: libncourses-devel (for make menuconfig)
       - The D-Link DNS-313 GPL-sources, I think, you have they already downloaded.
       - Unpack the Sources in an folder as you like, inside you will find an archive named "dns313_src.tgz"
       - Unpack this archive in an folder as you like, these are the real GPL-Sources.
       - Inside you should find an folder "opt", copy or move the content of this folder into your /opt directory. This is the engine for
           compiling your new kernel, the cross-compiler and many other tools.
       - go to the folder, where you unpacked the sources, containing the folders "opt", "Image" and "module".
       - type "cd Image" at commandline.
       - type "source source.me" (Produces some output, but don´t should say "error" or so...)
       - type "cd src/linux"
       - type "make menuconfig" (When you can see the menu now, you´re on the right way...)
       - play around with the options, but the first run of compiling a kernel is better without any changes.
       - Leave the menuconfig, type simply "make". Thats really enough to making a new kernel!
       - DONT WONDER ABOUT THE MANY, MANY WARNINGS! As pcp said, the D-LINK-code is crappy...
       - When all done without errors, you can find the new baken kernel in the directory Image/src/kernel.

ChBaer.

It seems I am doing exactly the same :-) but no success at the end :-(
What I would like is:
a) more file system support, ext2 has too many limitations (eg. static inode nr)
b) NFS support. If I am not mistaken NFS daemon is missing from Dlink's package I don't understand why. But it would be quicker this way I believe accessing from Linux/Mac.
c) langauge support, as I have problems storing files with filenames in localized language.

I would take your offer :-)

Offline

 

#25 2008-06-17 21:13:40

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

Re: image of the system partition/boot

CharminBaer wrote:

Hey, radir, take it easy...

There are  2 ways to get an well working new kernel:

1. Tell me (or us) the features you need and we will do our very best... After many unsuccessfull tries making a kernel is no more a problem for me.

Hi,

Appreciate your offer very much, no follow-up, no push at all just wondering: is there any technical obstacle to compile a kernel with my 'requirements'? As I don't see the difference between your process and mine ... I cannot figure out what could be the problem. For an exchange of kernel I can offer a fan control app, based on Pcp's code :-)

Thanks.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB