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 2007-06-04 22:47:37

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Parallels or VMware VM image with cross-compiling environment?

Has anyone created a VM image setup for cross-compiling for the DNS-323? I'd prefer a Parallels image but would be nearly as happy with one for VMWare.

Thanks.

Offline

 

#2 2007-06-05 00:39:33

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

Re: Parallels or VMware VM image with cross-compiling environment?

Don't have any images, but you can just install any GNU/Linux you like and then build the toolchain yourself.

If you need help building the toolchain, there are
a) scripts from magore (I think) here:
http://dns323.kood.org/howto:crosscompile
http://dns323.kood.org/forum/p1162-2007 … html#p1162
b) my scripts:
  http://www.inreto.de/dns323/source/fw10 … .2.tar.bz2

Offline

 

#3 2007-06-05 01:43:51

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

Thanks - I'll work from your scripts. It'll take me a few days to get to it.

In the interim, would you mind seeing if this compiles and throwing the module up somewhere for download? http://www.ardistech.com/hfsplus/hfsplu … 216.tar.gz

I'll do the testing on my system and report back.

Offline

 

#4 2007-06-05 02:24:25

kruzes
Member
Registered: 2007-05-31
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

Try this: http://download.yousendit.com/8209118775B97784
The URL is valid for 7 days. It's compiled from the Dlink kernel sources, not yours.

Offline

 

#5 2007-06-05 04:04:15

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

OK, got the kernel modules loaded, including the usb-storage.ko module from http://dev.skcserver.de/dns323/. usb-storage loaded, but gave some funky output while searching for LUNs on the device. I'm not sure if that's an artifact of AHCI or related to an issue between the module and my specific drive (a WD MyBook Pro 500GB drive).

As I was pasting in the dmesg output below, I just noticed the 'unknown partition table' message. Looks like this requires a new kernel capable of understanding the Mac partition map. Anyone with the setup in place feel like enabling it in a new kernel build so I can test it?

BTW - I'm happy to take on the task of documenting all of this in the wiki for other Mac users once we get this working.

Here's a snippet of what I was able to grab from dmesg - note that some of the output's missing as the message buffer was overwritten during output:

Code:

usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb 1-1: new high speed USB device using ehci_platform and address 2
usb-storage: USB Mass Storage device detected
usb-storage: -- associate_dev
usb-storage: Vendor: 0x1058, Product: 0x0903, Revision: 0x0106
usb-storage: Interface Subclass: 0x06, Protocol: 0x50
usb-storage: Transport: Bulk
usb-storage: Protocol: Transparent SCSI
usb-storage: usb_stor_control_msg: rq=fe rqtype=a1 value=0000 index=00 len=1
usb-storage: GetMaxLUN command result is 1, data is 0
usb-storage: *** thread sleeping.
scsi4 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
# dmesg
0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x2 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command READ_CAPACITY (10 bytes)
usb-storage:  25 00 00 00 00 00 00 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0x3 L 8 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 8 bytes
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x3 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.

{snip}

 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x2 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command READ_CAPACITY (10 bytes)
usb-storage:  25 00 00 00 00 00 00 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0x3 L 8 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 8 bytes
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x3 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
SCSI device sdc: 976773168 512-byte hdwr sectors (500108 MB)
sdc: assuming drive cache: write through
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command TEST_UNIT_READY (6 bytes)
usb-storage:  00 00 00 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0x4 L 0 F 0 Trg 0 LUN 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x4 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command READ_CAPACITY (10 bytes)
usb-storage:  25 00 00 00 00 00 00 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0x5 L 8 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 8 bytes
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x5 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
SCSI device sdc: 976773168 512-byte hdwr sectors (500108 MB)
sdc: assuming drive cache: write through
 sdc:<7>usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command READ_10 (10 bytes)
usb-storage:  28 00 00 00 00 00 00 00 08 00
usb-storage: Bulk Command S 0x43425355 T 0x6 L 4096 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_sglist: xfer 4096 bytes, 1 entries
usb-storage: Status code 0; transferred 4096/4096
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x6 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
 unknown partition table
Attached scsi disk sdc at scsi4, channel 0, id 0, lun 0
Attached scsi generic sg2 at scsi4, channel 0, id 0, lun 0,  type 0
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command (unknown command) (12 bytes)
usb-storage:  a0 00 00 00 00 00 00 00 10 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0x7 L 4096 F 128 Trg 0 LUN 0 CL 12
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 4096 bytes
usb-storage: Status code -32; transferred 0/4096
usb-storage: clearing endpoint halt for pipe 0xc0008280
usb-storage: usb_stor_control_msg: rq=01 rqtype=02 value=0000 index=81 len=0
usb-storage: usb_stor_clear_halt: result = 0
usb-storage: Bulk data transfer result 0x2
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x7 R 4096 Stat 0x1
usb-storage: -- transport indicates command failure
usb-storage: -- unexpectedly short transfer
usb-storage: Issuing auto-REQUEST_SENSE
usb-storage: Bulk Command S 0x43425355 T 0x80000007 L 18 F 128 Trg 0 LUN 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 18 bytes
usb-storage: Status code 0; transferred 18/18
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x80000007 R 0 Stat 0x0
usb-storage: -- Result from auto-sense is 0
usb-storage: -- code: 0x70, key: 0x5, ASC: 0x20, ASCQ: 0x0
usb-storage: (Unknown Key): (unknown ASC/ASCQ)
usb-storage: scsi cmd done, result=0x2
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad LUN (0:1)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (1:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (2:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (3:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (4:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (5:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (6:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (7:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: device scan complete

Here's the seg fault that comes from trying to mount it. Of course, it's no surprise the mount failed without an understandable partition map for the kernel:



Code:

Unable to handle kernel NULL pointer dereference at virtual address 0000000c
pgd = c163c000
[0000000c] *pgd=01493031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1]
Modules linked in: hfsplus usb_storage lltd sd_mod
CPU: 0
PC is at hfsplus_asc2uni+0x50/0x200 [hfsplus]
LR is at hfsplus_asc2uni+0x54/0x200 [hfsplus]
pc : [<bf032de0>]    lr : [<bf032de4>]    Not tainted
sp : c15c5b9c  ip : c15c5bcc  fp : c15c5bc8
r10: 00000000  r9 : 00000001  r8 : bf034194
r7 : c17cd006  r6 : 00000000  r5 : 0000001d  r4 : 00000000
r3 : 00000001  r2 : c15c5b9e  r1 : 0000001d  r0 : bf034194
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  Segment user
Control: A005317F  Table: 0163C000  DAC: 00000015
Process mount (pid: 5770, stack limit = 0xc15c4194)
Stack: (0xc15c5b9c to 0xc15c6000)
5b80:                                                                c15c5ba8
5ba0: c17cd000 c15c5bf0 00000000 00000001 c2643000 c2d6d400 c2643000 c15c5be0
5bc0: c15c5bcc bf02d948 bf032da0 c15c5bfc c202c860 c15c5e50 c15c5be4 bf02a1dc
5be0: bf02d8ec c202c860 c029b744 c0fa2a00 c31f77e0 0000001d bf034194 c17cd000
5c00: c17cd206 c2313800 00000000 00000000 00000000 00000000 00000010 00000001
5c20: 40006000 0000005f c379d9b8 c0332dc0 018ee0ff c379d9b8 c11ab818 c130c9b4
5c40: c15c5c60 c15c5c50 c011e0ec c011eac8 c130c800 c15c5c70 c15c5c64 c014c95c
5c60: c011e0e0 c15c5c88 c15c5c74 c0184764 c014c94c c12075e0 bf0030ac c15c5ca4
5c80: c15c5c8c bf0000e0 c0184744 c12075e0 fffffffa c130c800 c15c5cc8 c15c5ca8
5ca0: bf000488 c0186df8 c3c07060 c15c5cfc fffffffa c3c07060 c15c5cfc c15c5cf8
5cc0: c15c5ccc c009609c c0151ea8 00000000 00000001 c15c5cfc c3c07060 c15c5d84
5ce0: 00000000 c2643000 c2643000 c15c5e30 c15c5cfc c0096434 c0095fb0 00000000
5d00: 00000000 c3c070c4 00000000 00000000 00000000 00000000 00000000 00000000
5d20: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
5d40: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
5d60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
5d80: 00000000 00000000 00000000 c15c5cfc 00000000 00000000 00000000 00000000
5da0: 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000
5dc0: 00000000 c15c5e14 c15c5dd4 c0121acc c0120e58 00000000 c0fa2b40 00000007
5de0: 00000007 00000020 c0267062 c35c216c c15c5e54 00000000 c35c2160 c2643000
5e00: c2643000 c2643000 c0fa2b40 00000003 00000003 c15c5e54 c0fa2b40 c2643000
5e20: 00001000 c0fa2a00 c3c0707c c0fa2a00 c3c07060 00000001 c2643000 c2643000
5e40: c2643000 c15c5e94 c15c5e54 c0095170 bf029c98 00636473 fffffff4 c27c2000
5e60: c12072a0 00000009 c0db5ba0 c12072a0 c27c2000 c0db5ba0 c27c2000 fffffff4
5e80: bf036a64 00000001 c15c5ea8 c15c5e98 bf02a59c c0095060 bf029c88 c15c5ed0
5ea0: c15c5eac c00953bc bf02a590 ffffffff c27c2000 c2643000 00000001 c15c5f08
5ec0: 00000000 c15c5ef8 c15c5ed4 c00ab7b4 c009536c 00000001 00000000 c30ce000
5ee0: 00000000 c27c2000 c15c5f08 c15c5f70 c15c5efc c00abe80 c00ab740 c27c2000
5f00: c2643000 c17c5000 c3c68554 c0db59c0 c2643000 c15c5f78 c0ed0001 00000001
5f20: 00000001 00000000 c15c5f54 c15c5f40 c00abcf4 c0249ea8 20000013 c00abc84
5f40: 00001000 c15c5f70 00000000 00000000 00020088 c30ce000 c0ed0001 c15c4000
5f60: beb69c5c c15c5fa4 c15c5f74 c00ac2a8 c00abd40 c2643000 c2643000 c27c2000
5f80: c17c5000 000200e0 00020088 beb69cd4 00000015 c0024f44 00000000 c15c5fa8
5fa0: c0024dc0 c00ac214 000200e0 c002c9f4 00020088 00020098 000200b0 c0ed0001
5fc0: 000200e0 00020088 beb69cd4 00000001 0001e8f4 00000000 beb69c5c beb69f5d
5fe0: 4004efd8 beb69c4c 0000a49c 4004efe4 20000010 00020088 9922ea3f 8c03b1c5
Backtrace:
[<bf032d90>] (hfsplus_asc2uni+0x0/0x200 [hfsplus]) from [<bf02d948>] (hfsplus_cat_build_key+0x6c/0xa4 [hfsplus])
[<bf02d8dc>] (hfsplus_cat_build_key+0x0/0xa4 [hfsplus]) from [<bf02a1dc>] (hfsplus_fill_super+0x554/0x8a0 [hfsplus])
 r5 = C202C860  r4 = C15C5BFC
[<bf029c88>] (hfsplus_fill_super+0x0/0x8a0 [hfsplus]) from [<c0095170>] (get_sb_bdev+0x120/0x17c)
[<c0095050>] (get_sb_bdev+0x0/0x17c) from [<bf02a59c>] (hfsplus_get_sb+0x1c/0x24 [hfsplus])
 r8 = 00000001  r7 = BF036A64  r6 = FFFFFFF4  r5 = C27C2000
 r4 = C0DB5BA0
[<bf02a580>] (hfsplus_get_sb+0x0/0x24 [hfsplus]) from [<c00953bc>] (do_kern_mount+0x60/0x108)
[<c009535c>] (do_kern_mount+0x0/0x108) from [<c00ab7b4>] (do_new_mount+0x84/0xb8)
[<c00ab730>] (do_new_mount+0x0/0xb8) from [<c00abe80>] (do_mount+0x150/0x16c)
[<c00abd30>] (do_mount+0x0/0x16c) from [<c00ac2a8>] (sys_mount+0xa4/0xe8)
[<c00ac204>] (sys_mount+0x0/0xe8) from [<c0024dc0>] (ret_fast_syscall+0x0/0x2c)
 r8 = C0024F44  r7 = 00000015  r6 = BEB69CD4  r5 = 00020088
 r4 = 000200E0
Code: e1a00008 e1a01005 e24b202a e1a0e00f (e59af00c)

Last edited by ericlitman (2007-06-05 04:05:38)

Offline

 

#6 2007-06-06 00:23:49

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

Re: Parallels or VMware VM image with cross-compiling environment?

The segfault is no surprise. I had the same problem when I tested Paul's nfs kernel module. Problem is that the corresponding options need to be enabled in the kernel. If you feel brave enough, go ahead and compile your own kernel - it's not too difficult if you have a working toolchain. You can try my 'reloaded' module to boot your new kernel. I use it to boot self-made Linux filesystems, but afaik nobody has tried to reboot into the D-Link firmware yet, so you better have a working serial console for this.

Offline

 

#7 2007-06-06 00:32:39

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

I've been compiling the toolchain throughout the day today and hope to compile an updated kernel tonight.

Few questions:

1. I downloaded the toolchain and sources from inreto.de, which then goes off and grabs the kernel source from D-Link. Is the D-Link kernel source configured for production, ie if I were to compile it as is would it be a drop-in replacement for what D-Link ships, or do I need to pay close attention to configuring kernel parameters?

2. I haven't looked at your reloaded module, but I assume it somehow bootstraps a kernel other than the one pointed to by the firmware. Have you thrown up instructions for this anywhere?

3. I figured I'd need a serial console, but haven't done that yet. Maybe I'll hack that in this weekend...or maybe I'll just risk bricking my unit for a few days smile

Thanks.

Offline

 

#8 2007-06-06 00:54:35

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

Re: Parallels or VMware VM image with cross-compiling environment?

ericlitman wrote:

1. I downloaded the toolchain and sources from inreto.de, which then goes off and grabs the kernel source from D-Link. Is the D-Link kernel source configured for production, ie if I were to compile it as is would it be a drop-in replacement for what D-Link ships, or do I need to pay close attention to configuring kernel parameters?

the fw103-scripts is just a bunch of scripts, no "toolchain" or "sources" included. It downloads stuff from D-Link and invokes the commands needed to build the bare minimum.
D-Link's kernel comes with .config file. I haven't checked whether it exactly matches the shipped kernel.

ericlitman wrote:

2. I haven't looked at your reloaded module, but I assume it somehow bootstraps a kernel other than the one pointed to by the firmware. Have you thrown up instructions for this anywhere?

there are very basic instructions and an example script on my site. it's basically a kernel module for the shipped/running firmware kernel. when insmod'ded, it will load your custom kernel (and initramfs, optionally).

ericlitman wrote:

3. I figured I'd need a serial console, but haven't done that yet. Maybe I'll hack that in this weekend...or maybe I'll just risk bricking my unit for a few days smile

the risk to brick it is minimal if you load your own root file system. not sure what can happen when booting from the flash... good luck and take care.

Offline

 

#9 2007-06-08 02:51:52

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

fonz wrote:

the fw103-scripts is just a bunch of scripts, no "toolchain" or "sources" included. It downloads stuff from D-Link and invokes the commands needed to build the bare minimum.

Understood.

fonz wrote:

there are very basic instructions and an example script on my site. it's basically a kernel module for the shipped/running firmware kernel. when insmod'ded, it will load your custom kernel (and initramfs, optionally).

Very slick. I saw in another post from you that you were able to get this successfully working.

fonz wrote:

the risk to brick it is minimal if you load your own root file system.

I'm having a bitch of a time getting a crosscompiling environment setup under Debian 6.06.1 LTS server. ld refuses to link busybox from objects compiled by gcc from D-Link's distribution, even when using your scripts to run the process. I've spent several hours trying various versions of gcc 3.3.x and 3.4.x, playing with compile time switches, and am now giving up on this version of Debian to try another.

If you have a few minutes and a few CPU cycles to spare, would you mind compiling a kernel from your tree with Mac partition table support? This could end up saving me a ton of time.

Thanks.

Offline

 

#10 2007-06-08 10:17:00

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

Re: Parallels or VMware VM image with cross-compiling environment?

ericlitman wrote:

If you have a few minutes and a few CPU cycles to spare, would you mind compiling a kernel from your tree with Mac partition table support? This could end up saving me a ton of time.

Agreed, compiling the toolchain is a bit of a pain. I also don't know what the problem with your debian is - not using Debian myself.

I've already tried compiling a kernel with HFS support and it looked good. I'll post the kernel tonight when I'm at home.

Offline

 

#11 2007-06-08 20:22:36

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

Re: Parallels or VMware VM image with cross-compiling environment?

I've uploaded stuff to http://www.inreto.de/dns323/kernel/2.6.12.6-hfs/
There's a kernel image (zImage), the "standard" kernel modules (linux-...tgz) and the modules from the hfsplus package.
I haven't tried the kernel myself yet, and I'm also not sure if I got the options right...

Last edited by fonz (2007-06-08 20:22:50)

Offline

 

#12 2007-06-08 22:20:37

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

Nice, thanks! I'll give it a shot and report back.

Offline

 

#13 2007-06-09 00:40:05

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

OK, I'm stymied.  So I put a basic initramfs together, loaded it onto the box at the root level, and started to go through the steps of killing processes to be able to unmount the SATA RAID when it struck me: I can't unmount it logged in via telnet because telnetd is open from that mount point.

I suppose I could modify fun_plug to copy telnetd to the root partition and launch from there...

Last edited by ericlitman (2007-06-09 01:09:07)

Offline

 

#14 2007-06-09 01:08:12

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

Getting closer. I have telnetd launching from the root partition and it appears that the kernel loads to some extent, but without a serial console it's difficult to tell where it's failing. I'm assuming at the moment it's related to my init script in the initrd I created. Mind sharing one you've used (an init script or better still a functioning initrd)?

Last edited by ericlitman (2007-06-09 01:58:59)

Offline

 

#15 2007-06-09 03:01:51

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

Re: Parallels or VMware VM image with cross-compiling environment?

ericlitman wrote:

but without a serial console it's difficult to tell where it's failing. I'm assuming at the moment it's related to my init script in the initrd I created. Mind sharing one you've used (an init script or better still a functioning initrd)?

Sure, I'll upload my initramfs  tomorrow - it's late now. You mean, you don't have your serial cable ready yet?

Offline

 

#16 2007-06-09 03:20:14

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

Nope, not yet. Maybe next weekend if there's time.

Offline

 

#17 2007-06-09 16:42:31

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

Re: Parallels or VMware VM image with cross-compiling environment?

fonz wrote:

Sure, I'll upload my initramfs  tomorrow

It's there. Same directory. I had to create a new kernel image (the first one didn't boot very well here, too).
I've booted this one successfully on my box. The initramfs has busybox, e2fsprogs and mdadm, so you can try to mount your raid.

Offline

 

#18 2007-06-12 18:15:16

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

Got it all booting perfectly, thanks. Alas, the usb-storage module you posted has a different kernel version magic number. Should be the last step in this odyssey. Mind throwing up a new one compiled against that kernel, or just compiling it into the kernel if that's easier?

Thanks for all the help in this!

Offline

 

#19 2007-06-12 18:27:09

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

Re: Parallels or VMware VM image with cross-compiling environment?

ericlitman wrote:

Alas, the usb-storage module you posted has a different kernel version magic number.

Will have a look at it tonight.  So you're serious about rebooting into D-Link firmware?

Offline

 

#20 2007-06-12 18:34:11

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

Yes. What I'd ideally like to do is simply replace the D-Link supplied kernel with one that supports Mac partition types and then remount the default root and cramfs so that everything runs just as it did with the stock kernel. Barring that, I'll leverage your initramfs, grab /etc/raidtab, satamount/sataumount, etc., copy them into the initramfs, and work from files stored in the RAID.

I'm actually quite happy with the utilities and scripts supplied as part of your fun_plug package running under the default firmware. All that's missing for me is the ability to mount a Mac-formatted drive externally. But, if I need to compile Samba and the few other utilities I need to have a working NAS solution with a completely different Linux environment than the one D-Link ships so be it. None of the web management stuff is particularly important to me, so it would be no big loss to live without it if I had to.

Offline

 

#21 2007-06-12 18:43:28

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

Re: Parallels or VMware VM image with cross-compiling environment?

Just had another look at the files in 2.6.12.6-hfs/ directory. There's no usb-storage.ko module. Actually, I think support for usb storage is compiled into the kernel, no need to load a module. Have you verified that it's really missing?

Another thing I noticed during my experiments is that USB doesn't seem to be properly reset on "soft reboot". Try removing the USB disk, then "reload" and plug the USB disk back in.

PS: Try "zcat /proc/config.gz | grep USB"

Last edited by fonz (2007-06-12 18:45:14)

Offline

 

#22 2007-06-12 18:51:14

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

OK, will do. Do you have any thoughts on how I could boot that kernel back to the default, D-Link root, and leverage all the bootstrapping they do with the RAID, samba, running fun_plug, etc.?

Offline

 

#23 2007-06-12 19:25:54

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

So close!

Code:

SCSI device sdc: 976773168 512-byte hdwr sectors (500108 MB)
sdc: assuming drive cache: write through
 sdc: [mac] sdc1 sdc2 sdc3 sdc4
Attached scsi disk sdc at scsi4, channel 0, id 0, lun 0
Attached scsi generic sg2 at scsi4, channel 0, id 0, lun 0,  type 0
usb-storage: device scan complete
hfsplus: Unknown symbol vfs_permission
hfsplus: Unknown symbol get_gendisk

hfsplus

This is probably getting to the point where I really need to get a cross-compiling environment up and running. The hfsplus code that ships with the 2.4/2.6 kernel is old and unsupported, and likely needs to be replaced with the one I just linked.

In the unlikely event you feel like spending any more time on this, I linked the new version of hfsplus above. I'll plan to get things setup myself so you don't have to be stuck in the loop on this.

Thanks again.

Offline

 

#24 2007-06-12 21:03:37

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

Re: Parallels or VMware VM image with cross-compiling environment?

That's what I compiled. But it won't work. Just had a closer look: the "vfs_permission" function that the hfsplus module tries to use was removed around Linux 2.6.10. So my impression is rather that the hfsplus package from ardistech.com is outdated. Have you tried the other hfsplus module in /opt/lib/modules/2.6.12.6-arm1/kernel/fs/hfsplus (in linux-2.6.12.6-r0.tgz)? It loads fine here.

Offline

 

#25 2007-06-12 21:26:46

ericlitman
Member
Registered: 2007-06-04
Posts: 22

Re: Parallels or VMware VM image with cross-compiling environment?

Ah, no, I hadn't. I'll give that a shot tonight.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB