IG-88

How to build and inject missing drivers in jun loader 1.02a

Recommended Posts

kernel modules/drivers are specifically compiled for a kernel (-versions) and even distributions

it's not like windows where you can download a driver somewhere and just put it in

so don't take any *.ko file, stick it in and expect it to work

if you haven't build the *.ko yourself or don't know exactly where it came from, expect it to fail

I'm no expert but as there is no how-to here in the forum - lets start one

hopefully other will correct and help refine or take over and rewrite it

some steps are made in windows (osfmount) but will also possible in the chroot environment on linux

basic knowledge about using a linux console and command-line tools (or midnight commander) is needed, if you never used this you should not start with this how-to, choose something easier or invite someone who is able to help (do a workshop)

doing all this from scratch will take at least 1-2 hours, in most cases (re-read, google, try, google, try again, ...) much longer, maybe plan a weekend of text-adventure fun

 

edit: i think it also will do for 6.0.2 and loader 1.01 (not tested), kernel sources are available: https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/8451branch/bromolow-source/linux-3.10.x.txz/download, extra.lzma is a little differently placed (boot.img\image\DS3615xs\) but the steps will be the same

 

1. building the kernel module (driver)

 

1.1 what driver/module i need

you will have to find out (google) what the name of the driver/module is that your hardware needs or you will have to know where to find the rigt option in the menu-system of the kernel when configuring it

example: nForce 630 chipset with RTL8211E, you might expect it to be a realtek driver like rtl*.ko but it's not its "forcedeth.ko" because the RTL8211 is not a fully working PCIe Network Chip

in some cases you might be forced to find out by booting a linux distribution and look in /var/log/, use lspci or other tools

it also helps if the hardware provider has already compiled packages for specific distributions like redhat, you can look inside these packages for *.ko files

you also can look in the .config file of the kernel (more below) with a text editor to find a section where the module is mentioned, this will also give you a hint where to find it in the menu-system when configuring the kernel

 

1.2 you need the kernel source

in the case of synology that seemed sometimes difficult but at the moment there is kernel source for dsm 6.1

 

https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/

 

15047 is the synology build version and tells you about what dsm version it is (15057 = dsm 6.1) and what kernel was used to build the modules, it !!!might!!! change in a later version so always check for what version your bootloader from usb stick is made for (jun 1.02 is for 15047)

edit: dsm 6.1.1 has a new build number 15101 but seems to use the same kernel 3.10.102 as 6.1 so it should work with 6.1.1 too

 

as i write this for ds3615xs it's bromolow as a platform, for ds3617xs it's broadwell and ds916+ is braswell (you usually see that name on the update files for a synology system like "synology_broadwell_3617xs.pat")

so for ds3615xs we use this:

https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/15047branch/bromolow-source/linux-3.10.x.txz/download

edit: it looks like as for building the modules there is no difference for kernels modules build for 3615 and 3617 even if https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/15047branch/ has extra kernel sources for bromolow and broadwell, there are all intel x86_64, same might go for the 916+ (not testet yet), at least a evdev.ko build from 3615 kernel source did load without problems in a vm with the 3617 image

 

 

1.3 setting up a DSM 6.1 ds3615xs test environment with virtualbox (its free) or whatever works with juns loader

look in the forum to find something that works, basics for virtualbox are

- mac of the nic (intel pro 1000 desktop) in vm and grub.conf need to be the same

- boot controller for jun's image (vmdk with reference to img file) is ide, controller for dsm disks is scsi lsi (!!!)

- choose esx server option in grub menu

 

1.4 installing chroot

put in http://packages.synocommunity.com for custom packages and change the setting that beside synology packages trusted ones are also to install

install debian-chroot plugin (https://synocommunity.com/package/debian-chroot) from community section

(some info's about it: https://github.com/SynoCommunity/spksrc/wiki/Debian-Chroot#configure-services)

you might also install midnight commander if you are on it, makes things easier if you're not a command-line junky and more used to a graphical environment that give you clues

activate ssh in dsm

connect with ssh/putty to you dsm, login with user admin (and if you want to be root use "sudo -i")

start the chroot with:

/var/packages/debian-chroot/scripts/start-stop-status chroot
 

after that you are inside the chroot, check with ls and you won't see "/volume1" or other sysnology specific directory's from the dsm environment, you can leave the chroot environment with "exit" later if you want

now we have to update and install tools:

apt-get update
apt-get upgrade
apt-get install locales
dpkg-reconfigure locales
dpkg-reconfigure tzdata
apt-get install mc make gcc build-essential kernel-wedge libncurses5 libncurses5-dev libelf-dev binutils-dev kexec-tools makedumpfile fakeroot linux-kernel-devel lzma bc
 

after that we create a directory (lets say "test")

 

1.5 copying kernel files and create kernel modules

copy the downloaded kernel (linux-3.10.x.txz) to a share on the dsm, open a 2nd putty and copy the linux-3.10.x.txz (/volume1/...) to

/volume1/@appstore/debian-chroot/var/chroottarget/test/
 

(that's where the "test" directory of the chroot environment is located in your real system)

change back to your first putty where you are in chroot (the same way can be used to get the created files back to your shared folder on your volume1 which can be accessed from windows)

change into "test", extract the linux-3.10.x.txz to a directory named "linux-3.10.x" and change into it

the following copy's the kernel config file from synology to the right place for use/build

cp synoconfigs/bromolow .config
 

we make a fallback copy

make ARCH="x86_64" oldconfig
 

we start the ascii art menu and search for the missing driver to activate

cursor/return are your friend in navigating, space selects, we activate the driver to an "M" so its build as module (*.ko file we need)

there will be tons of descriptions how to do it, just google if needed

make ARCH="x86_64" menuconfig
 

on exit we save the configuration and with the following we make/create the modules (will take a while)

make ARCH="x86_64" modules
 

now you have to find your *.ko file (use some nice ls options, to be expanded later) usually you will have to look in /test/linux-3.10.x/drivers/scsi or block

 

copy that file to /test for easy access when we put it in the boot image

 

2. modify the "synoboot.img"

 

use osfmount (windows) to extract the "extra.lzma" (see dsm 5.2 to 6.0 guide, used there to edit grub.cfg in synoboot.img)

in "extra.lzma" are the additional *.ko files and a config file where the files to be loaded on boot are named

-> see forum thread "dsm 5.2 to 6.0" with howto to modify jun's loader for usb vid/pid and mac, its basically the same you just open the other partition (30MB) and extract the "extra.lzma"

copy the "extra.lzma" to the share of the dsm so we have local access in a putty session on dsm

in putty session #2 ("normal" session without chroot) we copy the "extra.lzma" to the "test" directory in the chroot environment

go to putty session#1 (in chroot)

decompress "extra.lzma" to "extra" ("extra.lzma" is a compressed cpio file) with:

lzma -d extra.lzma
 

with

ls
 

we can check that "extra.lzma" is now just ""extra" (a cpio file without the extension cpio)

create a new directory, copy the "extra" there, change into it and extract it with:

cpio -idv < extra
 

delete the remaining file "extra"

inside this directory we copy the *.ko file into usr/lib/modules/ and in /etc we edit the file rc.modules (easy with midnight commander, go to file, press F4, internal editor)

network drivers seems to be added under EXTRA_MODULES, storage drivers under DISK_MODULES, just go to the end of the line and fill in the name of the *.ko file without the ".ko", what you add is basically a blank and the name

rc.modules looks like this:

EXTRA_MODULES="mii mdio libphy atl1 atl1e atl1c alx uio ipg jme skge sky2 ptp_pch pch_gbe qla3xxx qlcnic qlge netxen_nic sfc e1000 pcnet32 vmxnet3 bnx2 libcrc32c bnx2x cnic e1000e igb ixgbe r8101 r8168 r8169 tg3 usbnet ax88179_178a button evdev ohci-hcd"
DISK_MODULES="BusLogic vmw_pvscsi megaraid_mm megaraid_mbox megaraid scsi_transport_spi mptbase mptscsih mptspi mptsas mptctl ata_piix megaraid_sas mpt2sas mpt3sas"
EXTRA_FIRMWARES="bnx2/bnx2-rv2p-09ax-6.0.17.fw bnx2/bnx2-rv2p-09-6.0.17.fw bnx2/bnx2-rv2p-06-6.0.15.fw tigon/tg3_tso5.bin tigon/tg3_tso.bin tigon/tg3.bin"
 

 

if your controller or nic needs a firmware, you add the file under usr/lib/modules/firmware/ and add the appropriate line in EXTRA_FIRMWARES, if a extra directory inside "firmware" is used it has to be added to the name, see the bnx2 firmware files

 

after everything is in place we recreate the cpio file, re-compress it as lzma and write it in the directory above as "extra.lzma"

the command is used inside the directory where we extracted the file "extra" (command line taken from https://github.com/kref/scripts, its what jun uses to create it):

(find . -name modprobe && find . \! -name modprobe) | cpio --owner root:root -oH newc | lzma -8 > ../extra.lzma
 

in putty session #2 (without the chroot) we copy "extra.lzma" from the chroot position in filesystem to the location where we can access it from windows

if you still have osfmount open to the "synoboot.img" replace the "extra.lzma" with the new one, dismount and close osfmount - our new "synoboot.img" is ready to test it

 

ps: i was asked to make a video - thats much harder to change and i'm to old for this :wink:

Edited by IG-88
added bc to packet list, fixed typos
  • Like 4

Share this post


Link to post
Share on other sites

Thanks dude!

Finally got the dell R710 up on juns 1.02a (3615xs) img.

 

 

"apt-get lzma" is that up there?

Share this post


Link to post
Share on other sites
Thanks dude!

Finally got the dell R710 up on juns 1.02a (3615xs) img.

 

"apt-get lzma" is that up there?

 

cpio and lzma was working without installing explicitly (lzma -V was calling it XZ Utils), installed the package and now its "LZMA command line tool 9.22", does'nt hurt to have a newer one, added the package above

Share this post


Link to post
Share on other sites
Thanks dude!

Finally got the dell R710 up on juns 1.02a (3615xs) img.

 

 

"apt-get lzma" is that up there?

 

Do you mind sharing on the main thread what you did so that others can benefit? I answered to you in the main thread but you didn't respond on the matter.

Share this post


Link to post
Share on other sites

damn, after running a bit. I rebooted and got bad superblock on perc 6i. Panic.

It did rebuild on next boot, but something is not happy with Raid.

Share this post


Link to post
Share on other sites

Hi, nice How-to, do you think i can swap Bzimage too?

I'm in writing another howto but without using Xpenology box as devel machine, i have already setup a devel machine in which i can compile drivers, so i would like to use it instead of DSM

Share this post


Link to post
Share on other sites

i did it in a debian box and it worked fine with no issues so long as you have everything setup correctly. i think the guide is using a syno box because most everyone here has one.

Share this post


Link to post
Share on other sites
i think the guide is using a syno box because most everyone here has one.

 

yes, as i already had to use virtualbox for testing, it's easy to clone, backup, re-use or to rebuild from scrath

the barematel system is for real life usage, not a playground

 

 

Hi, nice How-to, do you think i can swap Bzimage too?

 

i would expect thats the part where some tinkering is needed to get around the "protections" (or traps?) synology has build in, so atm i'm not touching this, i'm not planing to dive deeper then compiling extra drivers and providing modified extra.lzma

 

 

I'm in writing another howto but without using Xpenology box as devel machine, i have already setup a devel machine in which i can compile drivers, so i would like to use it instead of DSM

 

whatever works is good, as long as it is easy to setup, the chroot plugin for DSM was a easy startpoint, a "normal distribution" with the usual tools und package repositorys might be more comfy in the end and will not so easy break as DSM/Xpenology (after one or the other update, -> 6.0.3 or 6.1.1)

Share this post


Link to post
Share on other sites

Jun use vanilla synology source, if you dig into boot image you can see modprobe command, i suspect to be the part in which Jun have worked, so is enough , i have to do some experiment :wink:

Share this post


Link to post
Share on other sites

So, i followed your tutorials and i got compiling working.. (giving me shit about usb drivers, so i disabled them.)

 

But i have a couple of qstions..

 

Where can i enable U36S drivers?

 

lspci gives me https://pci-ids.ucw.cz/read/PC/1b4b/9235

 

I believe its a Marvel 88SE9123 controller and google told me it's already in the achi.ko but whenever i compile that and replace the lmza.extra i cant find my box on the network.

When i insmod that ko file its giving me shit about symbols..

 

do you guys have any idea how to solve this?

Share this post


Link to post
Share on other sites

my board has a SE9172 and it does work ootb with jun 1.02a (ahci.ko from synology dsm)

the SE9123 is also supported by the ahci.ko (http://cateee.net/lkddb/web-lkddb/ATA.html) and that is part of dsm itself so it should be detected

 

whats " U36S"?

 

Quote
When i insmod that ko file its giving me shit about symbols..

1. i expect you are using 6.1.1_15101 and the kernel sources provided (yet) are only 15047 (so there is a difference and some drivers compiled with 15047 source will not work)

2. do not replace the drivers already provided by synology

 

did you see this about already compiled drivers and the compatibility problems with 6.1.1?

https://xpenology.com/forum/topic/7318-driver-extension-for-jun-102a3615xs/

 

Quote
do you guys have any idea how to solve this?

 

whats the hardware you are using, board, nic, controller

(as much facts and as less believing as possible)

Share this post


Link to post
Share on other sites

Im sorry, i made a typo.. its ASUS U3S6

 

Its this controller:

https://www.everythingusb.com/asus-u3s6 ... 18307.html

 

On my box i type lspci and i see this output..

 

0001:07:00.0 Class 0000: Device 1b4b:9235 (rev ff)

0001:08:00.0 Class 0000: Device 1b4b:9235 (rev ff)

0001:09:00.0 Class 0000: Device 1b4b:9235 (rev ff)

0001:0a:00.0 Class 0000: Device 1b4b:9235 (rev ff)

 

Looking for the id on this site:

https://pci-ids.ucw.cz/read/PC/1b4b/9235

 

and that gave me the chipset.. Im not sure if its got a SE9235 or a SE9123.

 

Im on DSM 6.1-15047

 

This is my hardware:

 

root@DiskStation:/# lspci
pcilib: Cannot open /proc/bus/pci/0000:0a/00.0
lspci: Unable to read the standard configuration space header of device 0000:0a:00.0
pcilib: Cannot open /proc/bus/pci/0000:09/00.0
lspci: Unable to read the standard configuration space header of device 0000:09:00.0
pcilib: Cannot open /proc/bus/pci/0000:08/00.0
lspci: Unable to read the standard configuration space header of device 0000:08:00.0
pcilib: Cannot open /proc/bus/pci/0000:07/00.0
lspci: Unable to read the standard configuration space header of device 0000:07:00.0

Above output it prolly the controller



00:00.0 Host bridge: Intel Corporation 4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 9 Series Chipset Family USB xHCI Controller
00:16.0 Communication controller: Intel Corporation 9 Series Chipset Family ME Interface #1
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection (2) I218-V
00:1a.0 USB controller: Intel Corporation 9 Series Chipset Family USB EHCI Controller #2
00:1b.0 Audio device: Intel Corporation 9 Series Chipset Family HD Audio Controller
00:1c.0 PCI bridge: Intel Corporation 9 Series Chipset Family PCI Express Root Port 1 (rev d0)
00:1c.3 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d0)
00:1c.4 PCI bridge: Intel Corporation 9 Series Chipset Family PCI Express Root Port 5 (rev d0)
00:1d.0 USB controller: Intel Corporation 9 Series Chipset Family USB EHCI Controller #1
00:1f.0 ISA bridge: Intel Corporation 9 Series Chipset Family H97 Controller
00:1f.2 SATA controller: Intel Corporation 9 Series Chipset Family SATA Controller [AHCI Mode]
00:1f.3 SMBus: Intel Corporation 9 Series Chipset Family SMBus Controller
03:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 04)
05:00.0 Ethernet controller: Intel Corporation 82572EI Gigabit Ethernet Controller (Copper) (rev 06)

Share this post


Link to post
Share on other sites

so, i made a mistake!

 

the achi.ko is working fine! But the controller is still not detected :grin:

Share this post


Link to post
Share on other sites

hi,

 

yes, i can see now that it is about one additionl controller but whats the systemboard and what other components (more/other controllers?)

 

whats the meaning of "On my box" - does it mean your desktop computer or your xpenology box, if the later its kind of impossible as you posted two different lspci results

 

the dokumentation and the drivers asus provides are only for 91xx, the lspci indicates that there ist a 92xx chip

have a look ar the pcie card, any markings from asus (is there realy witten "U3S6"?), what chips are on the card (sata, usb and pcie bridge chip)

maybe the pcie bridge need a driver to get the pcie sata chip working and xpenology does not have it?

 

as you have access to the box, can you provide a log, /var/log/dmesg

Share this post


Link to post
Share on other sites

Im at work now so i cant check it..

 

This output is just when i ssh in to my xpenology box.. im root:

 

root@DiskStation:~# lspci
0000:00:00.0 Class 0600: Device 8086:0c00 (rev 06)
0000:00:01.0 Class 0604: Device 8086:0c01 (rev 06)
0000:00:02.0 Class 0300: Device 8086:0412 (rev 06)
0000:00:03.0 Class 0403: Device 8086:0c0c (rev 06)
0000:00:14.0 Class 0c03: Device 8086:8cb1
0000:00:16.0 Class 0780: Device 8086:8cba
0000:00:19.0 Class 0200: Device 8086:15a1
0000:00:1a.0 Class 0c03: Device 8086:8cad
0000:00:1b.0 Class 0403: Device 8086:8ca0
0000:00:1c.0 Class 0604: Device 8086:8c90 (rev d0)
0000:00:1c.3 Class 0604: Device 8086:244e (rev d0)
0000:00:1c.4 Class 0604: Device 8086:8c98 (rev d0)
0000:00:1d.0 Class 0c03: Device 8086:8ca6
0000:00:1f.0 Class 0601: Device 8086:8cc6
0000:00:1f.2 Class 0106: Device 8086:8c82
0000:00:1f.3 Class 0c05: Device 8086:8ca2
0000:03:00.0 Class 0604: Device 1b21:1080 (rev 04)
0000:05:00.0 Class 0200: Device 8086:10b9 (rev 06)
0001:07:00.0 Class 0000: Device 1b4b:9235 (rev ff)
0001:08:00.0 Class 0000: Device 1b4b:9235 (rev ff)
0001:09:00.0 Class 0000: Device 1b4b:9235 (rev ff)
0001:0a:00.0 Class 0000: Device 1b4b:9235 (rev ff)

 

When i start chroot i get this output:

 

root@DiskStation:/# lspci
pcilib: Cannot open /proc/bus/pci
00:00.0 Host bridge: Intel Corporation 4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 9 Series Chipset Family USB xHCI Controller
00:16.0 Communication controller: Intel Corporation 9 Series Chipset Family ME Interface #1
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection (2) I218-V
00:1a.0 USB controller: Intel Corporation 9 Series Chipset Family USB EHCI Controller #2
00:1b.0 Audio device: Intel Corporation 9 Series Chipset Family HD Audio Controller
00:1c.0 PCI bridge: Intel Corporation 9 Series Chipset Family PCI Express Root Port 1 (rev d0)
00:1c.3 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d0)
00:1c.4 PCI bridge: Intel Corporation 9 Series Chipset Family PCI Express Root Port 5 (rev d0)
00:1d.0 USB controller: Intel Corporation 9 Series Chipset Family USB EHCI Controller #1
00:1f.0 ISA bridge: Intel Corporation 9 Series Chipset Family H97 Controller
00:1f.2 SATA controller: Intel Corporation 9 Series Chipset Family SATA Controller [AHCI Mode]
00:1f.3 SMBus: Intel Corporation 9 Series Chipset Family SMBus Controller
03:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 04)
05:00.0 Ethernet controller: Intel Corporation 82572EI Gigabit Ethernet Controller (Copper) (rev 06)

 

here is my dmesg:

 

https://justpaste.it/17bn4

Share this post


Link to post
Share on other sites
Im at work now so i cant check it..

 

This output is just when i ssh in to my xpenology box.. im root:

 

One thing worth noting, that the four 1b4b:9235 's are fake pci devices to emulate DS3615xs, so they do not need extra driver even if they are real devices.

 

btw, your article about ubuntu on windows is really interesting :smile:

Share this post


Link to post
Share on other sites
Im at work now so i cant check it..

 

This output is just when i ssh in to my xpenology box.. im root:

...

here is my dmesg:

 

https://justpaste.it/17bn4

 

as the 1b4b:9235 are to ignore, then there is nothing in the lspci output or dmesg that indicates something additional to you Asus H97M-PLUS board (with its 6 sata, the ASM1083 is part of the board), no hint for a device thats not identifyed

 

shure that the card is plugged in :smile:))

you might swap your xpenology stick temporyrily for one with a live linux (ubuntu?) and then have a look what lspci and dmesg bring up?

 

i have a SE9172 in my system (onboard) and it does work with the standard ahci driver, in dmesg it looks like this:

[Mon May 29 19:00:56 2017] pci 0000:04:00.0: [1b4b:9172] type 00 class 0x010601
[Mon May 29 19:00:56 2017] pci 0000:04:00.0: reg 10: [io  0xc040-0xc047]
[Mon May 29 19:00:56 2017] pci 0000:04:00.0: reg 14: [io  0xc030-0xc033]
[Mon May 29 19:00:56 2017] pci 0000:04:00.0: reg 18: [io  0xc020-0xc027]
[Mon May 29 19:00:56 2017] pci 0000:04:00.0: reg 1c: [io  0xc010-0xc013]
[Mon May 29 19:00:56 2017] pci 0000:04:00.0: reg 20: [io  0xc000-0xc00f]
[Mon May 29 19:00:56 2017] pci 0000:04:00.0: reg 24: [mem 0xdf410000-0xdf4101ff]
[Mon May 29 19:00:56 2017] pci 0000:04:00.0: reg 30: [mem 0xdf400000-0xdf40ffff pref]
[Mon May 29 19:00:56 2017] pci 0000:04:00.0: PME# supported from D3hot
...
[Mon May 29 19:00:59 2017] ahci 0000:04:00.0: irq 50 for MSI/MSI-X
[Mon May 29 19:00:59 2017] ahci 0000:04:00.0: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
[Mon May 29 19:00:59 2017] ahci 0000:04:00.0: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs

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