DSM 6.0.2 Loader ( was "A new loader for latest DSM")

DSM 6.0.2 Loader ( was "A new loader for latest DSM")

Postby jun » 20 Sep 2016 14:57

I've recently annouce that my work on a kernel mode dynamic patcher in this post
http://xpenology.com/forum/viewtopic.php?f=2&t=19737&start=10#p72514

Now seems everything work out of box on VMware, so it's pretty close to an everybody useable loader,
But lots of hardwares drivers are missing, to support as much hardware as possible requires some extra work,
So I hope these is some help from the community to built & test drivers, make it usable for everyone.

AMD users have a look 3rd Post.


Original post
I've upload a tar archive of the boot partion, it should be untar in to a usb drive's EFI System Partition.
I prefers EFI bootloader, so I used grub2-efi here, but you can install your prefered ones, even none-EFI ones.
the zImage is a vanilla synology kernel, ramdisk.lzma is repacked to add some network drivers plus my patcher.
you need change sn/mac/vid/pid as usual before installation.

and to make installer happy, usb drive seem should have at least 2 partitions, one for boot, and one for recovery I guess.

I suggest to test it on VM first, then add hardware drivers for boot on bare metals.

Below is how my usb drive looks like

$ sudo gdisk -l /dev/sdc
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdc: 32784384 sectors, 15.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 4308A165-B0A6-4EC9-8B8E-9BEFB00BF33F
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 32784350
Partitions will be aligned on 2048-sector boundaries
Total free space is 4061 sectors (2.0 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 31457280 15.0 GiB 8300 Linux filesystem
2 31459328 31868927 200.0 MiB 8300 Linux filesystem
3 31868928 32784350 447.0 MiB EF00 EFI System


$ mount|grep tmp1
/dev/sdc3 on /mnt/tmp1 type vfat (rw)


$ ls -l /mnt/tmp1/
total 24
drwxr-xr-x 3 root root 8192 Sep 18 17:19 EFI
drwxr-xr-x 5 root root 8192 Sep 20 21:16 grub
drwxr-xr-x 3 root root 8192 Sep 20 21:15 image

$ lsusb |grep Flash
Bus 001 Device 010: ID 058f:6387 Alcor Micro Corp. Flash Drive

link
https://mega.nz/#!c8kn3JAL!fy4a0sXuYfcv1Sx7adGbr2OS-guqMS4GLRH3TOFkNfY

Edit:
I add a few popular network & disk drivers, and create a boot image for VM.
Just add some scsi or sata disk, then boot, and follow normal installation process.
https://mega.nz/#!llU23QgA!oGaZQuQLe0fsx1tuGiSBoZ19DSfEQH5Aq3GJXfEjpHE

for esxi, pls use this link
https://mega.nz/#!Agt00ZDT!lN5blyZc4gMaj-mKt-xCxoTtle-7cLF0ui9bF6ZBnY0

Plus a usb boot image for bare metal in UEFI mode. pls consider it unstable, test at your own risk.
https://mega.nz/#!Z4UzWZxZ!hu9SZXpzJBTakHk7lO8pJfyHYb-YgGatI-Em9E3JXWI

EditEdit:

Many people reported that DSM ask you to reinstall forever.
It turn out that lack of a serial port caused the failure. That is really a surprise :o .
Anyway, I upload a new ramdisk to workaround the issue.
You should replace the image/DS3615xs/ramdisk.lzma in the boot partiton with this new one.

Edited post
The esxi and bare metal image are updated, so manually replace the ramdisk is not required.
Alternatively, VM users may add a serial port as a workaround.
Bare metal users can enable the serial port in bios if your board has one.

remaining problem:
Login to your DSM via ssh/telnet, your will see these messages in kernel log,
this is another consequence of lack of a serial console.
Code: Select all
[ 1360.575754] init: tty main process (13856) terminated with status 1
[ 1360.575823] init: tty main process ended, respawning
[ 1370.591635] init: tty main process (13881) terminated with status 1
[ 1370.591755] init: tty main process ended, respawning


To stop it from spam your log, you can stop/disable the tty serivce.

update:
above workaround is not enough for boards without serial port,
these unlucky guys should edit following serivce config manually, replace "console output" with "console none" after installation
Code: Select all
root@test:~# grep -r "^console output$" /usr/ 2> /dev/null
/usr/share/init/syno_poweroff_task.conf:console output
/usr/share/init/burnin_loader.conf:console output
/usr/share/init/udevtrigger.conf:console output
/usr/share/init/bs-poweroff.conf:console output
/usr/share/init/udevd.conf:console output


Another issue:
I've found a hidden check related to console,
everyone should edit grub.cfg, replace console=uart8250,io,0x3f8,115200n8 with console=ttyS0,115200n8

You have to change sn/mac/vid/pid as usual before installation !
If you don't edit vid/pid in grub.conf you will get error 13 (file corruption) during setup.

How to see the value of my VID & PID stick


EDIT by Trantor (10-28-2016):

Updated loader by Arcao latest images (10-28-2016) : https://mega.nz/#F!Oc8TCLgD!IiullNuGs95RlelM9SKd5w
Original post : viewtopic.php?f=2&t=20216&start=740#p76198

Sources for dev:
quicknick : https://github.com/quiknick/7274-kernel
setsunakawa : http://setsunakawa.ddns.net/synology/dsm6/


10/29:
It's time to release a loader with a proper version number now.
Here is my loader v1.0
https://mega.nz/#F!18kB1BTB!1ft3N5Hnrcnqsneu0aQUkA

New features & fix:

Support bios & uefi boot & VMware & ESXI
Fix cmos reset issue( at least on bios mode VMware workstation)
most configurations can be done via grub command line now.
Remember last boot entry.
Autodetect synoboot partitions, not extensively tested. It is still recommended to set correct vid/pid.
AMD CPU support, not extensively tested, there are a few positive report on the forum.
Add grub menu for reinstallation.
Add grub menu to force installation when interrupted due to "Disks Disabled" message, not extensively tested
Automatically apply workaround for boards without serial port.
Fix SATA disk order remap, and allow to set SAS disk starting no, but disk order are still not deterministic between SAS disks.
Fix SAS disk naming, not extensively tested, only with one SAS2008 based HBA and synology provided mpt2sas driver.
Add ata_piix support, tested on VMware and it does not crash, only complain about "Read current link speed fail", so I
assume it works :), this driver requires a bit of patching to the kernel, so I include it in the package.

Integrate up-to-date network drivers compiled by Arcao and Trantor.


Known issue:
When runing on a slow single core machine, there is a race condition causes the patcher loading too late.
the most obvious sign is console not working properly. I don't expected this to happen normally,
the only example is a VM on my laptop when running on battery. If anyone believes have this issue,
please send me a message.

Some ethernet drivers crash when set MTU above about 4096(Jumbo frame), I've not identified the culprit yet.


How to install:

find the vid/pid of your usb drive
Burn the image to the drive, optionally edit grub.cfg to set vid/pid and boot entry, OR
connect monitor/keyboard/serial console to your Box.
Press C during Grub boot menu to enter command line
Code: Select all
vid 0xXXXX
pid 0xYYYY

to configure pid and vid ("pid" and "vid" are command, and "XXXX", "YYYY" are you usb drive's vid,pid)
(There are a few other options can be config this way, you can read grub.cfg to know more detail.)
Press Esc to go back to boot menu
Select baremeta/baremetal AMD entry, press enter to boot.
If your encounter the "disk port disabled" error during installation, try the force install menu entry.
if both option does not work, you have to fallback to SataPortMap method,
type this line in grub command line, replace XX with appropriate value.
Code: Select all
append SataPortMap=XX


11/2:
as I promised, here is v1.01, download link is the same as v1.0
This update contains nothing fancy, mainly for inner peace,
Plus, I revert megaraid_sas mpt3sas to old version.

It's not shining new now, the title is obsolete
Last edited by jun on 08 Nov 2016 22:14, edited 17 times in total.
jun
 
Posts: 43
Joined: 19 Sep 2016 08:52

Re: A new loader for latest DSM

Postby Aigor » 20 Sep 2016 15:08

Cool Job, if i wanted to try, is tere some possbilities to have your software?
User avatar
Aigor
 
Posts: 309
Joined: 03 Apr 2013 16:54
Location: Roma Italy

Re: A new loader for latest DSM

Postby jun » 20 Sep 2016 15:20

10/28:

Recently, I've implenmented an advanced patching method, its interesting in principle.
So I utilize it to add AMD cpu support, hope it works :) . This is the updated zImage, please test and send your feedback.
https://mega.nz/#!Vk0E2RrL!eFRPWcnaXn9b ... Sihf5BTRG0
Last edited by jun on 28 Oct 2016 04:25, edited 1 time in total.
jun
 
Posts: 43
Joined: 19 Sep 2016 08:52

Re: A new loader for latest DSM

Postby WizP » 20 Sep 2016 16:35

An ISO of this would be perfect!
WizP
 
Posts: 8
Joined: 20 Jun 2016 13:08

Re: A new loader for latest DSM

Postby Hostilian » 20 Sep 2016 17:11

Nice work! :)
+1 for ISO. Would be handy, thanks!
Hostilian
 
Posts: 56
Joined: 17 Sep 2016 11:56
Location: Edinburgh

Re: A new loader for latest DSM

Postby LuckyNumber77 » 20 Sep 2016 18:19

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
LuckyNumber77
 
Posts: 1
Joined: 20 Sep 2016 18:15

Re: A new loader for latest DSM

Postby quicknick » 21 Sep 2016 02:48

compiling new kernel w/drivers now. Took snippets from Jun and will see how it runs in a few minutes.
quicknick
 
Posts: 138
Joined: 24 Mar 2016 18:05

Re: A new loader for latest DSM

Postby Aigor » 21 Sep 2016 08:42

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?
User avatar
Aigor
 
Posts: 309
Joined: 03 Apr 2013 16:54
Location: Roma Italy

Re: A new loader for latest DSM

Postby koalala » 21 Sep 2016 16:41

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
koalala
 
Posts: 13
Joined: 16 Apr 2016 07:03

Re: A new loader for latest DSM

Postby HellG » 22 Sep 2016 10:41

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
HellG
 
Posts: 1
Joined: 22 Sep 2016 08:52

Next

Return to XPEnology General discussion



x