If you haven't already done so, copy the config file to the root of the kernel src as '.config'.
Yes, I did that, once I worked out (the hard way) what is had to be called and where it had to go.
You can edit it manually to add nbd but it is normally recommended to use 'make config' to make changes since some options are dependent upon others.
The trouble is, it takes for-bloody-ever in interactive mode and you get so bored your hand just sits on the Return key and before you know it you've missed it. I've tried it both ways and there is only the one line changed anyway so a manual edit is much easier.
You need to set the CONFIG_BLK_DEV_NBD option to 'm' to create a module for nbd.
Ah, thanks, that is the magic and not obvious to anyone who doesn't already know. I was putting 'y'. How am I supposed to know? (rhet.)
Code:
make CROSS_COMPILE=mipsel-linux- config
make CROSS_COMPILE=mipsel-linux- modules
I used "make ARCH=mips CROSS_COMPILE=mipsel-linux-" and everything builds (*), some with some disturbing warnings.
(*) Once I'd downgraded "make" to version 3.81 of course, which wasted ages in itself, 'cos nothing later works.
Anyway, the good news is that the module builds. But the bad news is that it's 64 bytes shorter than af123's version and segfaults when I try and use it, which of course takes the box down. Comparing one with the other, the difference seems to come in between offsets 0x310 and 0x1580 in the .ko file.