Kernel building

All discussions/development regarding the Marvell mv5281 Chip can be placed here.
Forum rules
Please note the disclaimer before modifying your Synology Product.

Kernel building

Postby ldesnogu » Mon Oct 15, 2007 3:05 pm

I propose to have a single thread regarding Synology kernel build.
The aim is not to build a kernel to replace the one in the firmware, but just to gain more understanding of what's going on :)

Feel free to talk about your findings. I will update this post accordingly.

Here is what I found (note I was using 462 GPL sources).

1. The GPL sources are not complete. They at least lack the synobios module. This can be seen as follows:
Code: Select all
cp -p 88f5281-config .config
make ARCH=arm CROSS_COMPILE=/path/to/compiler
-->
arch/arm/Kconfig:810: can't open file "drivers/synobios/Kconfig"

To get around that problem, create the following file drivers/synobios/Kconfig
Code: Select all
config SYNOBIOS_407
        tristate "Syno BIOS module for DS407"
        ---help---
          Choosing this option will generate a kernel module

config SYNOBIOS_107_MV
        tristate "Syno BIOS module for DS107+"
        ---help---
          Choosing this option will generate a kernel module

The aim of that file is just to avoid modifying Synology config file.

2. With the above file added, kernel compilation fails later. It simply can't compile as is with gcc 4.2. If you use Synology compiler, these patches are not needed.
a. in include/asm-arm/setup.h, remove line 224 ("extern struct meminfo meminfo;")
b. in drivers/scsi/libata-scsi.c move prototype of ata_scsi_translate just before the function ResubmitCommand.

3. After the above modifications, the kernel builds but it lacks some modules, which proves the config file provided in the GPL sources does not match what is in the firmware (or it is due to the fact I am looking at GPL sources that don't match my firmware :D).
Last edited by ldesnogu on Tue Oct 16, 2007 11:26 am, edited 1 time in total.
ldesnogu
Novice
Novice
 
Posts: 57
Joined: Sat May 19, 2007 4:18 pm

Postby m.aicardi » Tue Oct 16, 2007 1:20 am

Would you please explain exactly HOW did you tried to build the kernel?

Thanks.

Marco
User avatar
m.aicardi
Student
Student
 
Posts: 63
Joined: Tue May 29, 2007 2:37 pm

Postby ldesnogu » Tue Oct 16, 2007 8:02 am

m.aicardi wrote:Would you please explain exactly HOW did you tried to build the kernel?

Hum I think my post tells everything except for unpacking :)

1. unpack GPL sources
2. go to linux-2.6.15 directory
3. create drivers/synobios/Kconfig
4. patch include/asm-arm/setup.h and drivers/scsi/libata-scsi.c
5. cp -p 88f5281-config .config
6. make ARCH=arm CROSS_COMPILE=/usr/local/arm-marvell-linux-gnu/bin/arm-marvell-linux-gnu-

Hope this helps
ldesnogu
Novice
Novice
 
Posts: 57
Joined: Sat May 19, 2007 4:18 pm

Postby ptyfeng » Tue Oct 16, 2007 11:07 am

I followed these steps and successfully built the kernel. But I didn't do the step 4(patching). And I didn't get any errors. What's the matter, Laurent?
Synology Model: CS-407 | Firmware Version: 510 | HD Model: Seagate ST3750640AS
User avatar
ptyfeng
Novice
Novice
 
Posts: 45
Joined: Mon Sep 17, 2007 11:04 am

Postby ldesnogu » Tue Oct 16, 2007 11:10 am

ptyfeng wrote:I followed these steps and successfully built the kernel. But I didn't do the step 4(patching). And I didn't get any errors. What's the matter, Laurent?
It's probably due to the fact that I used a more recent compiler during my first trials (4.2.0) which is more strict.
Good to know there's nothing to patch using Syno compiler :)
ldesnogu
Novice
Novice
 
Posts: 57
Joined: Sat May 19, 2007 4:18 pm

Postby ptyfeng » Tue Oct 16, 2007 11:14 am

But can you explain that what your /synobios/Kconfig does? I can't understand it. Sorry I'm a beginner.

PF
Synology Model: CS-407 | Firmware Version: 510 | HD Model: Seagate ST3750640AS
User avatar
ptyfeng
Novice
Novice
 
Posts: 45
Joined: Mon Sep 17, 2007 11:04 am

Postby ldesnogu » Tue Oct 16, 2007 11:22 am

ptyfeng wrote:But can you explain that what your /synobios/Kconfig does? I can't understand it. Sorry I'm a beginner.

That file is used to configure the Synology Hardware Monitor Module (which source was not provided by Synology).
It is read by ./arch/arm/Kconfig so it has to exist.

Basically I said that the kernel should build Synology Hardware Monitor Module. Since we lack its sources, it's just ignored.
If you look /lib/modules contents on your Syno you will see that module: synobios.ko.

I just wanted to build the kernel without modifying any file, especially the config file.
ldesnogu
Novice
Novice
 
Posts: 57
Joined: Sat May 19, 2007 4:18 pm

Postby ptyfeng » Wed Oct 17, 2007 2:49 am

Thank you Laurent. :wink:

Since too many public open source projects don't rely on synobios, we can build many things we want to enhance our boxes now. :D

1. Following the steps above(except step 4), build the kernel.
2. Copy "asm", "asm-generic" and "linux" in "include" to the "include" of the toolchain from Franklin.

Then we have a complete toolchain. :wink:
Synology Model: CS-407 | Firmware Version: 510 | HD Model: Seagate ST3750640AS
User avatar
ptyfeng
Novice
Novice
 
Posts: 45
Joined: Mon Sep 17, 2007 11:04 am

Postby PosterBoy » Fri Nov 30, 2007 7:43 pm

Where should the file 88f5281-config file come from? I can't find it in the Kernel files or the crosscompiler files or google...

Is it: /usr/local/arm-marvell-linux-gnu/arm-marvell-linux-gnu.crosstoolconfig.txt

Thanks
PosterBoy
Beginner
Beginner
 
Posts: 20
Joined: Wed Nov 28, 2007 4:40 pm

Postby ldesnogu » Tue Dec 04, 2007 10:10 am

PosterBoy wrote:Where should the file 88f5281-config file come from? I can't find it in the Kernel files or the crosscompiler files or google...

It comes with Syno GPL release.

/usr/local/arm-marvell-linux-gnu/arm-marvell-linux-gnu.crosstoolconfig.txt

No, that file is the config that was used to build cross gcc.
ldesnogu
Novice
Novice
 
Posts: 57
Joined: Sat May 19, 2007 4:18 pm

Re: Kernel building

Postby dguido » Fri Apr 18, 2008 11:08 pm

This topic was immensely useful and helped me to compile a isofs module. Thanks!

viewtopic.php?f=41&t=6279&p=33505#p33505
dguido
Apprentice
Apprentice
 
Posts: 99
Joined: Wed Oct 17, 2007 8:52 am

Re: Kernel building

Postby ldesnogu » Sat Apr 19, 2008 10:09 am

And I thought no one was interested in that :) Anyway glad it helped you!
ldesnogu
Novice
Novice
 
Posts: 57
Joined: Sat May 19, 2007 4:18 pm

Re: Kernel building

Postby bzhou » Sun Jun 29, 2008 7:54 am

Thanks for the excellent guide. I've automated the build process and added a lot of kmods to the optware/syno-x07 feed.

To use, take isofs as example

Code: Select all
ipkg update
ipkg install module-init-tools
ipkg install kernel-module-zlib-inflate kernel-module-isofs
depmod -a
modprobe isofs


Cheers,

-Brian
bzhou
Knowledgeable
Knowledgeable
 
Posts: 344
Joined: Sat Jan 12, 2008 1:57 am

Re: Kernel building

Postby laith.said » Wed Nov 12, 2008 8:44 pm

Guys, I could build the kernel, but can I load the new kernel? or is only modules that I need to insert in my old kernel

Sorry for the newbies question, I'm trying to add ts support so that I can perform controlled traffic shaping.
laith.said
Trainee
Trainee
 
Posts: 15
Joined: Fri Jun 20, 2008 7:47 pm

Re: Kernel building

Postby micro87 » Wed May 13, 2009 4:05 pm

I'd also like to know if the new kernel can be loaded. Anyone who knows?
micro87
I'm New!
I'm New!
 
Posts: 3
Joined: Fri May 01, 2009 12:00 pm

Next

Return to Marvell mv5281 Development Room

Who is online

Users browsing this forum: No registered users and 0 guests