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 2011-01-22 15:16:17

IcyK
Member
From: The Netherlands
Registered: 2011-01-17
Posts: 10

Ramdisk too big ...

Hi,

I've tried to rebuild the ramdisk and compile it with the Dlink GPL sources.
I followed the instructions on curvedbrain.org, exept instead of

Code:

dd if=/dev/zero of=new-ramdisk.img bs=1k count=8k

I had to use count=10k (to reflect the size of the original Dlink ramdisk that came with the source).

But when I tried to rebuild the uRamdisk (with NO changes in the ramdisk whatsoever, just strip the original uRamdisk to .gz, gunzip, mount, make new-ramdisk.img, copy original Ramdisk to new-ramdisk.img, gzip new-ramdisk.img) it had grown bigger than the original and too big to merge into firmware.

So my question: Has anyone tried something similar, and how did you succeed?
Is there some kind of special compression needed (I used gzip -9), since the original ramdisk is smaller than the new ramdisk, but both contain exactly the same files?

Last edited by IcyK (2011-01-22 15:16:53)

Offline

 

#2 2011-01-22 19:54:53

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Ramdisk too big ...

Did you compare the loopmounted images using df? Maybe you resolved symlinks instead of copying them?

Offline

 

#3 2011-02-06 02:14:24

IcyK
Member
From: The Netherlands
Registered: 2011-01-17
Posts: 10

Re: Ramdisk too big ...

I compared them, the home made one is bigger.
But even the re-packed image.cfs is bigger, though I didn't change a thing!

These were the steps (left out some sudo's):
- split firmware using splitdns323fw
- remove the uboot header from initrd -> result: DNSramdisk.gz
- gunzip DNSramdisk.gz

- mount -o loop DNSramdisk ./ramdisk
- mount -o loop ./ramdisk/image.cfs ./image
- cp -R ./image/* ./tmpcramfs
- mkcramfs tmpcramfs new-image.cfs

ls -al ./ramdisk/image.cfs:

Code:

 -rwx------ 1 root root 5881856 2009-12-18 03:22 ramdisk/image.cfs

ls -al ./new-image.cfs:

Code:

 -rw-r--r-- 1 root root 6762496 2011-02-06 00:48 new-image.cfs

So ... I didn't change a thing, but the new image.cfs is about 1 MB bigger than the original one ...

Anyone who can shed a light on this?

Offline

 

#4 2011-02-06 15:12:38

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Ramdisk too big ...

If you now loopmount new-image.cfs also, then df -B 1 can tell you if the filecontents are the same.

Offline

 

#5 2011-02-06 16:23:33

IcyK
Member
From: The Netherlands
Registered: 2011-01-17
Posts: 10

Re: Ramdisk too big ...

Whow, huge difference:

Code:

 /home/dick/dns/ramdisk/image.cfs
                       5898240   5898240         0 100% /home/dick/dns/image
/home/dick/dns/new-image.cfs
                      15593472  15593472         0 100% /home/dick/dns/new-image

It also seems that some directories in the new image is a tiny bit bigger:

Code:

 ~/dns/image$ du *           ~/dns/new-image$ du *

2396    bin                2396    bin
259    codepages            259    codepages
27    default                29    default
15    driver                16    driver
1    etc_codepage            1    etc_codepage
2    files                    2    files
64    language                64    language
2681    lib                2681    lib
41    lltd                    41    lltd
1305    LPRng            1305    LPRng
2586    samba            2587    samba
2524    sbin                2527    sbin
19    scsi                    20    scsi
0    shared_name/CD            1    shared_name/CD
0    shared_name/CR            1    shared_name/CR
0    shared_name/HD            1    shared_name/HD
0    shared_name            4    shared_name
207    upnp                    207    upnp
885    web                        886    web
223    web_page/advanced    224    web_page/advanced
37    web_page/bt/img        38    web_page/bt/img
113    web_page/bt        114    web_page/bt
228    web_page/formatHD    229    web_page/formatHD
85    web_page/function    85    web_page/function
61    web_page/help        62    web_page/help
112    web_page/home        113    web_page/home
117    web_page/images        118    web_page/images
28    web_page/module        29    web_page/module
22    web_page/status        23    web_page/status
205    web_page/tools        206    web_page/tools
126    web_page/user        126    web_page/user
1347    web_page            1356    web_page

So I guess itś not resolved symlinks (in that case only a few directories would be significant bigger).

Thanks Mijzelf for the help so far ... (sounds funny in dutch ;-) )

Offline

 

#6 2011-02-07 10:46:12

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Ramdisk too big ...

I don't see any difference in the du outputs which excuses the difference in the df output. What is the du output of ./tmpcramfs?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB