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-02-06 20:15:51

szidomingo
Member
Registered: 2010-02-06
Posts: 7

DNS 321 and Fonz's fsck

Hi!

I'm trying to run the fsck tool that Fonz made, but I'm running into trouble. I tried searching around and I couldn't find much about other people running into problems here at the forums.

I have a DNS 321 A2, and uname -r gives me "2.6.22.7", if that is at all relevant.

In all honesty I have seen Fonz make an offhand comment in one of the threads that it should at least work for Rev A1 DNS 321s, and another user commenting that we with the DNS 321 can't have everything such as defrag. That's about all the relevant info (I'm not too sure it is relevant of course, I am fairly new at this) I could dig up. It's all rather vague to me I am afraid.

After installing the fsck package (and bash), I try to run it with "bash ./reload.sh", but all I get is:

ERROR: reloaded-2.6.22.7.ko: No compatible 'reloaded' module found for this kernel.

Is the problem that there is no 2.6.22.7 kernel included in the fsck package? Is there a workaround to fix this?

It's not horribly important I have gotten way more out of the DNS 321 with Fonz's funplug than I have ever hoped (thank you Fonz!), but I'd love to read something about how I could run e2fsck without Fonz's kernel.

Thanks for any help, insight and/or in advance!
D

Offline

 

#2 2010-02-06 22:47:48

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: DNS 321 and Fonz's fsck

szidomingo wrote:

ERROR: reloaded-2.6.22.7.ko: No compatible 'reloaded' module found for this kernel.

Is the problem that there is no 2.6.22.7 kernel included in the fsck package? Is there a workaround to fix this?

The "reloaded" program to boot the fsck system must be compiled specifically for the firmware kernel on your device. I don't think anybody did that for the 321, yet. Further, you need a kernel that boots on your 321, e.g. one could try to extract the firmware kernel.

Offline

 

#3 2010-02-08 00:11:42

szidomingo
Member
Registered: 2010-02-06
Posts: 7

Re: DNS 321 and Fonz's fsck

Thank you Fonz for the reply!

Well if it doesn't work it doesn't work. However, I am more than willing to act as a guinea pig for making a version of reloaded for the 321.

I am no expert of course, only been messing with Linux for a month now, but I can read, and follow instructions, so if someone takes the time to walk me through the process of extracting a working kernel, and compiling the reloaded program specifically for the 321 I would gladly do it so that it could be included in the fsck package for future use.

I am assuming the compilation part should be the easier, and I might just be able to read up on that front here at the forums, and the extraction of the kernel being a bit more tricky. But then again, I don't have any idea, really smile

Any takers? smile

Offline

 

#4 2010-02-08 10:26:02

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: DNS 321 and Fonz's fsck

Mijzelf adapted the reloaded modules for the NSA-220. Adaptation for the 321 will be much simpler, I guess. Still, the related thread may contain useful info: http://dns323.kood.org/forum/viewtopic.php?id=3434

Offline

 

#5 2010-02-17 03:04:13

szidomingo
Member
Registered: 2010-02-06
Posts: 7

Re: DNS 321 and Fonz's fsck

Wow, I never expected this to be easy, but this is really hard. I know the last thing you need is a noob asking silly questions, and I told myself that I will get as far as I possibly can - it's good learning -, but after reading the linked thread a thousand times (thanks for digging it up Fonz), and a ton of others here on the forum, and googling the topic, I seem to be stuck at some basic questions... It's been a while sine I felt this helpless with computers smile

I understand that to compile a kernel module, I need the source of the kernel I am running, in this case 2.6.22.7, which I got.  I also have the .config from the GPL'd kernel source from D-Links site, but I don't think I need that yet.

My initial idea was to compile the reloaded source against the kernel on the DNS itself, but I am not so sure anymore it is possible. Is it possible to do it with ffpbuildenv or will I have to set up a crosscompile environment with the DLink supplied toolchain etc? I can't seem to find the answer to this anywhere...

So I guess I don't have much to show for countless sleepless nights spent poring over Linux tutorials, forums etc I know. Thank you for any insights in advance.

Offline

 

#6 2010-02-17 10:11:23

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: DNS 321 and Fonz's fsck

For the DNS-323, I had to use a gcc-3 version to compile the kernel module - Linux 2.6.12 just doesn't compile with gcc-4.
With 2.6.22.7, it should work with gcc-4, and it should work with the gcc from ffp.

If you're going to compile complete kernels though (e.g. the kernels you'r going to boot), I recommend using a cross-compiler on a fast computer. It'll take ages on the DNS. However, building cross-compilers is quite complicated and can be very frustrating. Luckily, you only need the very simplest cross-compiler for the kernel, i.e. binutils and the first gcc. See this guide:
http://www.eglibc.org/cgi-bin/viewcvs.c … s-building

Good luck.

Offline

 

#7 2010-03-13 01:22:39

szidomingo
Member
Registered: 2010-02-06
Posts: 7

Re: DNS 321 and Fonz's fsck

Hi Fonz, I thought I'd give a quick status update on how far I got, and ask for further pointers.

1) Saved the source of the 2.6.22.7 kernel and the .config of the older GPLd kernel on the DNS
2) Read all of the links you gave and a ton of other links, and guessed that I'd spend at least a week or two trying to set up a cross compile environment (only background in XP, so I'd need to figure out virtual machines, and a real distro, and then setting up the actual environment).
3) Did a make oldconfig. This took me a day or so to realize... I took all the default answers to the extra config options after reading them which was 'no' 99% of the time.
4) Did a make dep clean zImage. I guess dep wasn't needed. After 1h 20m the kernel compiled, so it wasn't bad at all. Actually a lot better than the full day or so I had expected. And I walked away learning about the very useful 'screen' utility.
5) Took out the 'CROSS_COMPILE=${FUN_TARGET}-' part from the reloaded utility's make file as I was going to compile on the box itself, and did a make. Reloaded.ko compiled fine.

So now I have a compiled 2.6.22.7 kernel with 'factory D-Link settings', and a reloaded module compiled for it. I haven't had the guts to try to load the 2.6.22.7 kernel that I made to try out if reloaded works, but I guess the worst that will happen is that I have to reboot the DNS321, right?

I'm guessing that none of the zImages that you supplied with fsck would work for me (although again, I was too afraid to try), so what are the .config options that I need to use to build such a kernel image for the DNS321?

Again, I am very very appreciative of all the help you have given me so far!

Edit: I guess I need to get my hands on an initrd... can I extract that somehow from running system?

Last edited by szidomingo (2010-03-13 05:53:47)

Offline

 

#8 2010-03-13 21:26:13

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: DNS 321 and Fonz's fsck

I suggest you try my initramfs from http://www.inreto.de/dns323/fsck/
This reboots into a separate system, and won't touch your disks.

For this, the kernel must have the network autoconfig option enabled. I think it's CONFIG_IP_PNP (Networking -> Networking Options -> IP: Kernel level autoconfiguration). This enables the 'ip=...' command line option used in the reload script. For documentation, see Documentation/nfsroot.txt in the kernel source tree. Make sure that you pass the correct device name (on the dns-323 it's egiga0 or eth0).

Of course, there's no guarantee that all this is safe. If it's going really bad, you might lose all the data on the disks.

Last edited by fonz (2010-03-13 21:31:27)

Offline

 

#9 2010-10-06 04:35:06

szidomingo
Member
Registered: 2010-02-06
Posts: 7

Re: DNS 321 and Fonz's fsck

Sorry, it took me a while to try what you said, Fonz. I got a little distracted, and then summer rolled around, and now it's 7 months later smile

So I got the initramfs.gz you have on your website, and modified the no-bash-reload.sh script so that it uses egiga0 (that is what appears in the DNS-321's dmesg), and ran the script with the 2.6.22.7 kernel that I previously compiled (I did check and CONFIG_IP_PNP was enabled, so I didn't have to compile again).

I didn't work, but at least I didn't lose any of the data on the disc. smile

I don't know if it helps or not but here is what happened, after which the DNS-321 just stayed in limbo, with the lights on, but not answering any pings.

./no-bash-reload_egiga.sh zImage-2.6.22.7
kernel:   /mnt/HD_a2/reloaded/zImage-2.6.22.7
cmdline:  console=ttyS0,115200 ip=192.168.1.50::192.168.1.1:255.255.255.0:DNS-321:egiga0:none
machtype: 1542
+ sync
+ mount -o remount -r /mnt/HD_a2
mount: mounting /dev/sda2 on /mnt/HD_a2 failed: Device or resource busy
+ mount -o remount -r /mnt/HD_a4
+ mount -o remount -r -a
mount: mounting rootfs on / failed: Invalid argument
mount: mounting /dev/root on / failed: No such file or directory
+ mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw)
proc on /proc type proc (rw)
/dev/loop0 on /sys/crfs type squashfs (ro)
/dev/sda2 on /mnt/HD_a2 type ext3 (rw,data=ordered,usrquota,grpquota)
/dev/sda4 on /mnt/HD_a4 type ext3 (ro,data=ordered)
none on /proc/bus/usb type usbfs (rw)
devpts on /dev/pts type devpts (rw)
+ sync
+ sleep 1
+ insmod /mnt/HD_a2/reloaded/reloaded-2.6.22.7.ko machtype=1542 kernel=/mnt/HD_a2/reloaded/zImage-2.6.22.7 initrd=/mnt/HD_a2/reloaded/initramfs.gz cmdline=console=ttyS0,115200 ip=192.168.1.50::192.168.1.1:255.255.255.0:DNS-321:egiga0:none

After this a simple cable pull, and the DNS-321 was back in working order.

Any ideas which way I should try to be going from here? Any ideas for me?

Offline

 

#10 2010-10-26 04:58:34

szidomingo
Member
Registered: 2010-02-06
Posts: 7

Re: DNS 321 and Fonz's fsck

Well in the meantime, I went with this script (had a couple of missing quotes at the very end, but it was simple to fix), and it seems to do the trick on the DNS 321.

http://dns323.kood.org/forum/viewtopic. … 201#p29201

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB