Andy928

Kernel building

Recommended Posts

Andy,

 

Thanks. I need time to study and try.

 

Any more clue on adding custom firmware driver? Thanks.

Share this post


Link to post
Share on other sites

Hi !!!

 

Thank you for this great job and for the tuto. My new kernel is ready (just for add Promise TX4130 support) but how to make a new synoboot ?

 

Thank you for the answer.

 

(Sorry for my bad English)

Share this post


Link to post
Share on other sites

Dear Andy,

 

Can you tell more about Synobios Modification? should we use HEX editor to edit the file?

 

Thank you.

Share this post


Link to post
Share on other sites
Can you tell more about Synobios Modification? should we use HEX editor to edit the file?

 

I use two instruments: IDA (Disassembler) and HIEW (Hex Editor).

Share this post


Link to post
Share on other sites

Hi,

 

great project here !

 

Because NxxL NAS Systems from HP are very popular it would be nice to be able to run xpenology on it.

 

But the NxxL series use an AMD64 processor, so I think the kernel building decribed here will not work.

 

I'm a LINUX newbee and in the future I think I'm not able to do the kernel building by myself.

 

Is there any plan to demonstrate a AMD64 kernel building to ?

 

Maybe I can try to run xpenology in VirtualBox, but I think that slow down things.

Share this post


Link to post
Share on other sites
Hi,

 

great project here !

 

Because NxxL NAS Systems from HP are very popular it would be nice to be able to run xpenology on it.

 

But the NxxL series use an AMD64 processor, so I think the kernel building decribed here will not work.

 

I'm a LINUX newbee and in the future I think I'm not able to do the kernel building by myself.

 

Is there any plan to demonstrate a AMD64 kernel building to ?

 

Maybe I can try to run xpenology in VirtualBox, but I think that slow down things.

 

If you mean N36L and N40L, check the forum, you will find that many (including me) have XPEnology installed in those systems without having to virtualize, nighthawk even compiled modules to make the USBs functional....

Share this post


Link to post
Share on other sites

Hi,

 

i build my own kernel and put the zImage onto my USB-Stick and into the *.pat. Additionally i changed the synobios.ko in both rd.gz on my USB-Stick plus in rd.gz and hda1.tgz inside the *.pat file.

 

The whole installation process worked fine but after a reboot it shows up again my installation Interface and provides only the ability to migrate my configuration and data with a new installation. (Status migrateable)

 

Did i forget sth or do someone knows what i did wrong?

 

 

 

thanks for any advice!

 

UPDATE:

 

okay there are no data on the harddrive.. but the installer told me everythings worked fine after installation. Now i try to install another *.pat and then extract the hda1.tgz onto the hdd.. hopefully i get success because the modules of the other *.pat seems to be incompatible with my kernel build but both Versions are 3202.

Share this post


Link to post
Share on other sites

Thank you for this project. do you free to show us how to build a SynoBoot.img and add more hardware support?

Share this post


Link to post
Share on other sites

Aigor,

 

|Thank you for your reply.

I have to dig in some more Linux knowledge because that's new for me. I am used to Windows development but have no experience with Linux.

I will read and follow the example on this forum on how to build the DSM kernel. With that knowledge I do think a Areca driver will be easy.

When I am ready I will post it on this forum.

Share this post


Link to post
Share on other sites
Aigor,

 

|Thank you for your reply.

I have to dig in some more Linux knowledge because that's new for me. I am used to Windows development but have no experience with Linux.

I will read and follow the example on this forum on how to build the DSM kernel. With that knowledge I do think a Areca driver will be easy.

When I am ready I will post it on this forum.

You are welcome :grin: for what i saw in file, just run make install and the kernel module goes in /lib/modules , successufuly will be gret if it's possibile to include the driver directly in the kernel, i think would be simple

Share this post


Link to post
Share on other sites

from what I have read I do have to prepare a Ubuntu 12.10 (virtual) computer.

On that I can compile kernels and also drivers (.ko).

 

I'll start with installing Ubuntu :smile:

Or maybe there are some other forum members who are able to do the driver compiling for me :roll: .

 

I have now successfully installed 3202 (DSM 4.2) on a standard Quadcore Intel PC with a Intel Dual Server Netwerk adapter.

I am trying to make a NAS with at least 24x4TB disks in it connected by 2x Areca ARC-1230-16 controller.

This would give me a lot of fast storage in one NAS.

 

It would be perfect if we could get a DS-10613xs+ of DS-3413xs+ system running on a 'standard' PC.

The xs+ series do have SSD caching option.

Share this post


Link to post
Share on other sites
from what I have read I do have to prepare a Ubuntu 12.10 (virtual) computer.

On that I can compile kernels and also drivers (.ko).

 

I'll start with installing Ubuntu :smile:

Or maybe there are some other forum members who are able to do the driver compiling for me :roll: .

 

I have now successfully installed 3202 (DSM 4.2) on a standard Quadcore Intel PC with a Intel Dual Server Netwerk adapter.

I am trying to make a NAS with at least 24x4TB disks in it connected by 2x Areca ARC-1230-16 controller.

This would give me a lot of fast storage in one NAS.

 

It would be perfect if we could get a DS-10613xs+ of DS-3413xs+ system running on a 'standard' PC.

The xs+ series do have SSD caching option.

i Hope you use this nas in you house :grin: due to nature of hacks, i will avoid to install fake DSM on production environement because you dont have any support

Share this post


Link to post
Share on other sites

I must admit that I lack some knowledge to build my own kernel... A lot of people are asking "please add support for XXX", and the current kernel building guide is a little bit obscure for novices like me. And in the same time, I would like to be able to add the support of my own devices without depending on other members, and why now, to contribute to the releases. If I understand correctly, you'll have to rebuild the kernel and adding the support of new devices each time Synology release a new DSM build. The GPL sources of DSM 4.2 build 3211 will be available soon, and I would really like to be able to build my own kernel for my devices with this release, and the next releases, directly from the Synology GPL sources.

 

I someone feeling okay to write an "idiot's guide" for kernel building, or maybe to edit the current guide with more insights ? That would be great for the community.

Share this post


Link to post
Share on other sites
I must admit that I lack some knowledge to build my own kernel... A lot of people are asking "please add support for XXX", and the current kernel building guide is a little bit obscure for novices like me. And in the same time, I would like to be able to add the support of my own devices without depending on other members, and why now, to contribute to the releases. If I understand correctly, you'll have to rebuild the kernel and adding the support of new devices each time Synology release a new DSM build. The GPL sources of DSM 4.2 build 3211 will be available soon, and I would really like to be able to build my own kernel for my devices with this release, and the next releases, directly from the Synology GPL sources.

 

I someone feeling okay to write an "idiot's guide" for kernel building, or maybe to edit the current guide with more insights ? That would be great for the community.

Hi tomek, it depends to the hardware you want support, many drivers are included in the kernel tree, some special hardware has own driver, this lasts comes like stand-alone drivers that you have to compile and add in /lib/modules folder on the nas, others types comes like patch to apply on the kernel tree, for what i saw it's enough compile on the kernel like modules and the game is on

Share this post


Link to post
Share on other sites

I recompiled the kernel with DSM 4.2 toolchain (adding sata_via support for a VIA VT6421 PCI SATA card). Everything seemed to go well - I was able to start the PC with modified USB-key, but after some 25 seconds, it sent the kill signal and the PC went off.

I've got error messages, stating:

 

loop: version magic '3.2.30 SMP mod_unload ' should be '3.2.11 SMP mod_unload '

The system is going down NOW!

 

I suspect this discrepancy being the cause for the kernel panic.

Any idea for a workaround, how to get things running?

 

Regards

Share this post


Link to post
Share on other sites
I recompiled the kernel with DSM 4.2 toolchain (adding sata_via support for a VIA VT6421 PCI SATA card). Everything seemed to go well - I was able to start the PC with modified USB-key, but after some 25 seconds, it sent the kill signal and the PC went off.

I've got error messages, stating:

 

loop: version magic '3.2.30 SMP mod_unload ' should be '3.2.11 SMP mod_unload '

The system is going down NOW!

 

I suspect this discrepancy being the cause for the kernel panic.

Any idea for a workaround, how to get things running?

 

Regards

 

It is apparently a version mismatch with some modules. It seems like if you had a newer version module (3.2.30) on an older kernel (3.2.11), and it fails to load the SMP module. Did you replace both the zImage and all the kernel modules?

 

Thank you for this project. do you free to show us how to build a SynoBoot.img and add more hardware support?

 

As far as my research goes, SynoBoot.img is a simple DD dump of a custom-made GRUB boot USB.

It contains two partitions:

1. A small, 16MB partition for kernel zImage, minimal initfs rd.gz, and GRUB config

2. A bigger partition, around 200MB,contains the same zImage, rd.gz, PLUS the DMS filesystems (checksum files, hda1, etc.)

 

Creating a working boot drive should be fairly easy, even by hand.

Create an empty 256MB file

dd if=/dev/zero of=./boot.img bs=1M count=256

Then create an according loop mount, and attach this file

mknod /dev/loop[NUM] b 7 [NUM]
losetup /dev/loop[NUM] boot.img

After this, you can use fdisk to create the two partitions, then use grub-install to install grub on the device (don't forget to mount the first partition, create a boot folder, and target grub-install to that folder. It will be overwritten, but otherwise it fails to install). FS format should be ext2.

When all is done, pop an existing SynoBoot drive in your PC, and copy the contents, then you can modify it.

 

When all done, do an umount boot.img, and dd it onto the flash drive. Then double-check it, set a bootable flag, and you're done!

 

I've began working on a kitchen for editing these firmwares (and compiling kernel, patching, etc.), but given that I can't really boot any kernels as of now, it is quite hard to test. So either hardware donation (anything small that can boot up Synology), or some help with the i386 kernel support can come handy!

Share this post


Link to post
Share on other sites
It is apparently a version mismatch with some modules. It seems like if you had a newer version module (3.2.30) on an older kernel (3.2.11), and it fails to load the SMP module. Did you replace both the zImage and all the kernel modules?

Thanks for that! Well, to be honest, I just did the procedure mentioned in the first posting ( http://xpenology.com/wiki/en/building_xpenology ). And from it only the kernel building part and the checksum trick. From the remainder I just used the modified *.pat from Synology DS3612xs - DSM 4.2 build 3202 found here, replacing zImage and the checksum files. The synobios.ko found there is already modified in order to start from the start USB key, as far as I understand - so this should not be the problem.

 

I coocked my desired driver inside the kernel (not as sata_via.ko, but included in the kernel). Indeed it seems to be a version mismatch. But I have no clue, where to find newer kernel source code in order to provide in the proces of compilaiton. I just downloaded the source code from andy's project on github with the following command:

 

git clone https://github.com/andy928/xpenology.git linux-3.x

 

I did not try this with DSM 4.1. Maybe it will work there. I suspect the provided modules (*.ko) inside the *.pat to be 3.2.11, so it should match the kernel version. But I wanted to use the newest available Build, which is the DSM 4.2 3202 (OK, excluding the 3211 build which source code is not freely available yet).

 

Appreciate any further hints for solving the problem :smile:

 

Cheerz

Share this post


Link to post
Share on other sites
It is apparently a version mismatch with some modules. It seems like if you had a newer version module (3.2.30) on an older kernel (3.2.11), and it fails to load the SMP module. Did you replace both the zImage and all the kernel modules?

Thanks for that! Well, to be honest, I just did the procedure mentioned in the first posting ( http://xpenology.com/wiki/en/building_xpenology ). And from it only the kernel building part and the checksum trick. From the remainder I just used the modified *.pat from Synology DS3612xs - DSM 4.2 build 3202 found here, replacing zImage and the checksum files. The synobios.ko found there is already modified in order to start from the start USB key, as far as I understand - so this should not be the problem.

 

I coocked my desired driver inside the kernel (not as sata_via.ko, but included in the kernel). Indeed it seems to be a version mismatch. But I have no clue, where to find newer kernel source code in order to provide in the proces of compilaiton. I just downloaded the source code from andy's project on github with the following command:

 

git clone https://github.com/andy928/xpenology.git linux-3.x

 

I did not try this with DSM 4.1. Maybe it will work there. I suspect the provided modules (*.ko) inside the *.pat to be 3.2.11, so it should match the kernel version. But I wanted to use the newest available Build, which is the DSM 4.2 3202 (OK, excluding the 3211 build which source code is not freely available yet).

 

Appreciate any further hints for solving the problem :smile:

 

Cheerz

 

I am having same problem here. Any idea? Thanks!

Share this post


Link to post
Share on other sites