jun

DSM 6.1.x Loader

Recommended Posts

Hy, im new in this Topic..., so sorry for my question. :roll:

Is it now possible to get a running DSM 6.0 VM with this tgz file?

When yes, maybe some one can tell me how? :geek:

 

thanks

lucky

Share this post


Link to post
Share on other sites

Maybe a dumb question, if i wanted compile my own set of drivers i need to have kernel source of kernel version running, so i need kernel version from synology.

Do i miss something?

Share this post


Link to post
Share on other sites

Hi jun, could you provide me your loader and the kernel sources please ? I'll try on ESXI and on bare metal.

Do you have a github repo for this loader ?

 

Kind regards

Share this post


Link to post
Share on other sites

Hi jun,

you seem to know what you are doing so maybe you could help me to understand the protection mechanisms of the Synology DSM 6.

I have a DS710+ (2 bay Intel Atom D410) which does not get any further updates beyond DSM 5.x (5592). I was able to create a pat file to install DSM 6.0 (7321) by just changing the update file for the DS712+ (2 bay Intel Atom D425). I just changed the synoinfo.conf, scemd.conf and manutil.conf according to what I found in the latest DS710+ update and after repacking I was able to update my box to DSM 6.0 version 7321 (and also the subsequent updates to patchlevel 7).

With the same method I was able to create an update file for DSM 6.0.2 version 8451, however now I have the same problems as others reportet here that have accidentially updated to 6.0.1 (7393) or 6.0.2 (8451): existing volumes are gone and cannot be mounted and I cannot create new volumes. I did a little research but I have no clue how I could get around the protection. For example the devices nodes for sda are not created under /dev so scemd complains about not able to access /dev/sda. If I login via ssh and create them with mknod they exist for a while but as soon as I log into the Web UI or only reload it they are gone again.

Do you know if there is documentation about how the protection mechanism works or could you maybe give me some hints how I could make it work? Maybe even your kernel mode dynamic patcher could help me with this? I would appreciate it if you could give me some help.

 

Best regards,

HellG

Share this post


Link to post
Share on other sites

This is very interesting :smile:

Unfortunately I'm very busy at work and have no time for XPEnology.

 

I'm glad that people continue to develop this project.

 

Don't forget that compiling kernel from Syno sources is very tricky.

Syno don't release all sources, some parts are missing like iscsi and synoacl.

 

Using original syno kernel + additional modules is very great but should prevent us to edit some part of the kernel.

You can use XPEnoboot 5.2 sources if you want to check how I did to add/update drivers and/or the HARDWARE SUPPORTED LIST to ckeck drivers names.

 

For exemple Broadcom tg3, bnx2 and bnx2x are higly patched in order to have successful compilation. Intel and realtek are very easy to update.

Keep in mind that including latest version of module/driver allow more hardware support that using sources from kernel tree.

 

Happy XPEnologing :mrgreen:

Share this post


Link to post
Share on other sites

Trantor,

 

If you look at a directory diif with meld using the OEM rd.gz, xpenology rd.gz, and Jun's ramdisk.lzma, you can see some of the differences ande how he injected the code, but like you, still waiting on source to include in the kernel and hide the module. Very clever stuff Jun! I am pm'ing you with location to upload source.

 

I also agree that the source does not include all parts. That is why in very spare time I am working on complete patch from open source kernel and synologies open source kernel so that we can move to any version of kernel and make it easier to include the synology modded and missing stuff.

Share this post


Link to post
Share on other sites
Hi jun,

you seem to know what you are doing so maybe you could help me to understand the protection mechanisms of the Synology DSM 6.

I have a DS710+ (2 bay Intel Atom D410) which does not get any further updates beyond DSM 5.x (5592). I was able to create a pat file to install DSM 6.0 (7321) by just changing the update file for the DS712+ (2 bay Intel Atom D425). I just changed the synoinfo.conf, scemd.conf and manutil.conf according to what I found in the latest DS710+ update and after repacking I was able to update my box to DSM 6.0 version 7321 (and also the subsequent updates to patchlevel 7).

With the same method I was able to create an update file for DSM 6.0.2 version 8451, however now I have the same problems as others reportet here that have accidentially updated to 6.0.1 (7393) or 6.0.2 (8451): existing volumes are gone and cannot be mounted and I cannot create new volumes. I did a little research but I have no clue how I could get around the protection. For example the devices nodes for sda are not created under /dev so scemd complains about not able to access /dev/sda. If I login via ssh and create them with mknod they exist for a while but as soon as I log into the Web UI or only reload it they are gone again.

Do you know if there is documentation about how the protection mechanism works or could you maybe give me some hints how I could make it work? Maybe even your kernel mode dynamic patcher could help me with this? I would appreciate it if you could give me some help.

 

Best regards,

HellG

Hi,

The are various check around DSM programs, especially in Web Interface, maybe some are still not found out.

 

One kind is to make sure you are running on real DSM hardwares, specifically, it checks that you have pci devices the model should have. This check is a bit forgiving, i.e., if you only have 9 out of the 10 devices, you may still pass the check. Some models have mcu to control powers, leds, fans, DSM also checks that it can communicate with the controller properly.

 

Another kind of check is to make sure your system does not have any clue that you pretend to be a DSM model, for example has some file named xpenoboot somewhere,or has pid, vid in kernel cmdline, these should not exists in a real DSM devices. Sometimes, it also checksum each other to make sure system executables are not patched.

 

If DSM determines that is is not run on intended hardware, it will try to unmount all your volumes, shutdown the system, sometimes also corrupt some DSM system files etc. No sign of intentionally breaking user data is observed though.

 

Clearly, your DSM software thinks that it is not running on a real DS712+ device, so it unmounts all your volumes.

And what I did is to make sure DSM gets what it wants, so it will run happlily and ignorantly.

Share this post


Link to post
Share on other sites
This is very interesting :smile:

Unfortunately I'm very busy at work and have no time for XPEnology.

 

I'm glad that people continue to develop this project.

 

Don't forget that compiling kernel from Syno sources is very tricky.

Syno don't release all sources, some parts are missing like iscsi and synoacl.

 

Using original syno kernel + additional modules is very great but should prevent us to edit some part of the kernel.

You can use XPEnoboot 5.2 sources if you want to check how I did to add/update drivers and/or the HARDWARE SUPPORTED LIST to ckeck drivers names.

 

For exemple Broadcom tg3, bnx2 and bnx2x are higly patched in order to have successful compilation. Intel and realtek are very easy to update.

Keep in mind that including latest version of module/driver allow more hardware support that using sources from kernel tree.

 

Happy XPEnologing :mrgreen:

Thanks for your advice. Yes, dynamic patching has its obvious limitations. So the proper source code is still very usefull.

 

I have to admit I do not have time to maintain a large list of supported drivers either.

Share this post


Link to post
Share on other sites
Trantor,

 

If you look at a directory diif with meld using the OEM rd.gz, xpenology rd.gz, and Jun's ramdisk.lzma, you can see some of the differences ande how he injected the code, but like you, still waiting on source to include in the kernel and hide the module. Very clever stuff Jun! I am pm'ing you with location to upload source.

 

I also agree that the source does not include all parts. That is why in very spare time I am working on complete patch from open source kernel and synologies open source kernel so that we can move to any version of kernel and make it easier to include the synology modded and missing stuff.

 

DSM mainly checks /proc/bus/pci/devices, /sys/bus/pci/devices, /proc/cmdline and /dev/ttyS1.

You should provide the list of devices to first 2 pseudo files/folder, and hide unwanted entries from /proc/cmdline

plus /dev/ttyS1 should looks as if a mcu is attached on the other side (I am not very clear about the detail).

A bit of reverse engineering skill and kernel programming kung fu is all you need.

  • Like 1

Share this post


Link to post
Share on other sites
Hi,

The are various check around DSM programs, especially in Web Interface, maybe some are still not found out.

 

One kind is to make sure you are run on real DSM hardwares, specifically, it checks that you have pci devices the model should have. this check is a bit forgiving, i.e., if you only has 9 of the 10 devices, you may still pass the check.Some models have mcu to control powers, leds, funs, DSM also checks that it can communicate with the controller properly.

 

Another kind check is to make sure you system does not has any clue that you pretend to be a DSM model, for example has some file named xpenoboot somewhere,or has pid, vid in kernel cmdline, these should not exists in a real DSM devices. sometimes, it also checksum each other to make sure system executables are not patched.

 

if DSM determine that is is not run on intended hardware, it will try to umount all you volumes, shutdown the system, sometimes also corrupt some DSM system files etc. No sign of intentionally breaking user data is observed though.

 

Clearly, your DSM software think that it is not run on a real DS712+ device, so it umount all you volumes.

And what I did is to make sure DSM get what it wants, so it will running happlily and ignorantly.

 

Then maybe we should take some inspiration from what was done for Hackintosh with OSX. The loaders are patching ACPI tables (DSDT & SSDT) to make the devices recognized properly. We can actually use GRUB to load modified ACPI tables. Using that approach we should be able to add virtual devices & rename existing ones. We would be able to use vanilla kernel without any modification (as long as the devices are supported).

Share this post


Link to post
Share on other sites

There is quite a bit Synology has modified in their kernel since I have been dissecting the code. It appears they make certain calls to hw as Jun has also pointed out. While ACPI tables could work, a plain vanilla kernel will still need many Synology patches.

 

Sent from my SM-N930T using Tapatalk

Share this post


Link to post
Share on other sites

Hi,

 

I tried to install on bare-metal MSI N3150I ECO ITX board (celeron N3150), but installer always fails at 58% with error "Failed to install the file. The file is probably corrupted. (13)". On same setup i have installed latest 5.2 XPEnoboot without any problems. Any insights on this problem ?

Share this post


Link to post
Share on other sites

Jun, I tried your VM image on ESXi 6.0. However it is HW version 12 so it's not usable (max v11).

 

I converted it to V11 and for some reasons it does not work. There is exactly the same issue than the DSM6 from okstime, it installs fine but it wants to update every time you boot.

 

We have to use HW v10 but your image cannot be converted because you selected Debian + EFI and this is not supported by VMWare Converter. Could you please provide a VM Image with HW version 10 ?

 

Many thanks

Share this post


Link to post
Share on other sites
Hi,

 

I tried to install on bare-metal MSI N3150I ECO ITX board (celeron N3150), but installer always fails at 58% with error "Failed to install the file. The file is probably corrupted. (13)". On same setup i have installed latest 5.2 XPEnoboot without any problems. Any insights on this problem ?

 

maybe you did not change the vid/pid, so the installation process can not find the synoboot partitions.

 

I should make it clear that you need to change vid/pid BEFORE installation.

 

PS: DS716/916 should have better compatibility with your hardware, I'll release a DS916 version later when I can test it properly.

Share this post


Link to post
Share on other sites
Hi,

 

I tried to install on bare-metal MSI N3150I ECO ITX board (celeron N3150), but installer always fails at 58% with error "Failed to install the file. The file is probably corrupted. (13)". On same setup i have installed latest 5.2 XPEnoboot without any problems. Any insights on this problem ?

 

maybe you did not change the vid/pid, so the installation process can not find the synoboot partitions.

 

I should make it clear that you need to change vid/pid BEFORE installation.

 

PS: DS716/916 should have better compatibility with your hardware, I'll release a DS916 version later when I can test it properly.

 

You were right, somehow I really did miss to change vid/pid. :grin: Now installation goes smooth but after restart synology complains that my disks were moved from another DS3615xs and wants to reinstall/update os.

Share this post


Link to post
Share on other sites

Works out of the box on bare metal. Updates, raid group creation and volume creation with btfrs.

Virtual DSM, Docker DSM, both network adapters.

all seems working perfectly.

 

(Z77n-wifi - Xeon E3)

 

Thanks Jun for this release

Share this post


Link to post
Share on other sites
Hi,

 

I tried to install on bare-metal MSI N3150I ECO ITX board (celeron N3150), but installer always fails at 58% with error "Failed to install the file. The file is probably corrupted. (13)". On same setup i have installed latest 5.2 XPEnoboot without any problems. Any insights on this problem ?

 

maybe you did not change the vid/pid, so the installation process can not find the synoboot partitions.

 

I should make it clear that you need to change vid/pid BEFORE installation.

 

PS: DS716/916 should have better compatibility with your hardware, I'll release a DS916 version later when I can test it properly.

 

You were right, somehow I really did miss to change vid/pid. :grin: Now installation goes smooth but after restart synology complains that my disks were moved from another DS3615xs and wants to reinstall/update os.

 

Seem it can not mount /dev/md0 in the boot process, so falls back to installer, but in the installation process, disks are recognized correctly. So it looks a timing issue to me, will look into it.

 

EDIT:

I've found the root cause, and updated my thread, you may want to take another chance to see if it works.

Edited by Guest

Share this post


Link to post
Share on other sites

 

maybe you did not change the vid/pid, so the installation process can not find the synoboot partitions.

 

I should make it clear that you need to change vid/pid BEFORE installation.

 

PS: DS716/916 should have better compatibility with your hardware, I'll release a DS916 version later when I can test it properly.

 

You were right, somehow I really did miss to change vid/pid. :grin: Now installation goes smooth but after restart synology complains that my disks were moved from another DS3615xs and wants to reinstall/update os.

 

Seem it can not mount /dev/md0 in the boot process, so falls back to installer, but in the installation process, disks are recognized correctly. So it looks a timing issue to me, will look into it.

 

I was wondering how to change vid/pid. I'm facing same issue. :cry:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now