Jump to content
XPEnology Community

Automated RedPill Loader (ARPL)


fbelavenuto

Recommended Posts

57 minutes ago, pocopico said:

@fbelavenuto do you mind sharing the module build options ? I always wanted to create a how to for module and extension compilation but didn’t have the time or the willing 😛  more or less it is based on the syno released kernel source and the toolchain. Once i download these, the process goes like this 

 


 

KERNEL_SOURCE="/opt/dsm-kernel/broadwellnk/linux-4.4.x"
KHOME="/opt/dsm-kernel/broadwellnk"


function dsmmake(){

make \
CROSS_COMPILE="$KHOME/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/bin/x86_64-pc-linux-gnu-" \
CFLAGS="-I$KHOME/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/include/" \
LDFLAGS="-I$KHOME/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/lib/" \
RANLIB="/usr/bin/x86_64-linux-gnu-ranlib" \
LD="/usr/bin/x86_64-linux-gnu-ld" \
CC="/usr/bin/x86_64-linux-gnu-gcc" \
LD_LIBRARY_PATH="$KHOME/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/lib" \
-C "$KHOME/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/lib/modules/DSM-7.0/build/" \
ARCH=x86_64 M=`pwd` modules $@

}


cd $KERNEL_SOURCE/drivers/virtio/


dsmmake CONFIG_VIRTIO=m CONFIG_VIRTIO_MMIO=m CONFIG_VIRTIO_PCI=m CONFIG_VIRTIO_PCI_LEGACY=m CONFIG_VIRTIO_BALLOON=m CONFIG_VIRTIO_INPUT=m

 

 

I'm using this script:

 

https://github.com/fbelavenuto/arpl-modules/blob/main/src/.compile.sh

 

I use docker with old binutils/gcc instead toolchain from dsm

 

  • Like 1
Link to comment
Share on other sites

26 minutes ago, fbelavenuto said:

I'm using this script:

 

https://github.com/fbelavenuto/arpl-modules/blob/main/src/.compile.sh

 

I use docker with old binutils/gcc instead toolchain from dsm

 


please use the platform specific tool chain, the bin utils are not the only issue. There are syno specific libraries that should be taken into consideration during build.

 

wrong binutils will result in unloadable modules, not using the toolchain will cause KPs and trouble in loading modules following the module after the last loaded. 
 

it’s easy and can be scripted like you did for the previous ones. Just extract the kernel in one stable directory and the tool chains in different directories. Then call different script function for each platform. 

Edited by pocopico
  • Like 1
Link to comment
Share on other sites

On 7/20/2022 at 1:24 AM, Orphée said:

If you choose q35 machine, you will have a dummy/unused controller so your SataPortMap will have to be SataPortMap="1X" and DiskIdxMap="10XX" in my case : SataPortMap="18" DiskIdxMap="1000"

Your disks in DSM will start at sdb and will see first disk slot unsused.

 

Can you explain this more? So in my case, I have the dummy 6 port controller, then the 6 port controller with the sata0 img disk, then my 24 disk HBA card... What would my SatPortMap and DiskIdxMap be for this situation?

 

image.thumb.png.4d2aa1ca7e20c27c85c24fae71e48ec3.png

Link to comment
Share on other sites

How would I re-install DSM using this tool? My system was working fine then made a network config error in DSM and now it won't get an IP.

Physical syno box can "reset" button to reset network settings. I think for xpenology we need to do a re-install.

 

Link to comment
Share on other sites

2 hours ago, jrac86 said:

 

Can you explain this more? So in my case, I have the dummy 6 port controller, then the 6 port controller with the sata0 img disk, then my 24 disk HBA card... What would my SatPortMap and DiskIdxMap be for this situation?

 

image.thumb.png.4d2aa1ca7e20c27c85c24fae71e48ec3.png

Well,

I don't know how 24 disks are handled by the HBA card, and how it can be addressed in SataPortMap.

 

SataPortMap is set on only 1 digit... so 9 disks maximum... But I'm not an expert.

 

In my case, with the HBA 8 disks, my conf was :

 

SataPortMap=118 DiskIdxMap=100A00

 

1st controller = dummy/unused.

2nd controller = IMG Loader

3nd Controller = HBA card with my 8 slots

 

But no matter DiskIdxMap setting, the dummy/unused controller seems to always be in /dev/sda

 

So fist disk available in DSM is in slot 2.

 

image.png.725c6a640f4d160dc02b2cb44fcc4827.png

  • Like 1
Link to comment
Share on other sites

20 minutes ago, Orphée said:

Well,

I don't know how 24 disks are handled by the HBA card, and how it can be addressed in SataPortMap.

 

SataPortMap is set on only 1 digit... so 9 disks maximum... But I'm not an expert.

 

In my case, with the HBA 8 disks, my conf was :

 

SataPortMap=118 DiskIdxMap=100A00

 

1st controller = dummy/unused.

2nd controller = IMG Loader

3nd Controller = HBA card with my 8 slots

 

But no matter DiskIdxMap setting, the dummy/unused controller seems to always be in /dev/sda

 

So fist disk available in DSM is in slot 2.

 

image.png.725c6a640f4d160dc02b2cb44fcc4827.png

 

Actually, we were able to reach 30 ports. Read the below and a few posts after that.

 

 

SataPortMap values are neither decimal nor hex its based on ASCII values.(WTF? I know) 

Edited by pocopico
  • Like 1
  • Confused 1
Link to comment
Share on other sites

10 hours ago, pocopico said:


please use the platform specific tool chain, the bin utils are not the only issue. There are syno specific libraries that should be taken into consideration during build.

 

wrong binutils will result in unloadable modules, not using the toolchain will cause KPs and trouble in loading modules following the module after the last loaded. 
 

it’s easy and can be scripted like you did for the previous ones. Just extract the kernel in one stable directory and the tool chains in different directories. Then call different script function for each platform. 

 

it would be cool to being able to add custom user modules on loader build, like if someone wants to add the extra Intel GPU ko in the tgz.

 

well it can be done before building via cli easily tho.

Link to comment
Share on other sites

2 hours ago, pigr8 said:

 

it would be cool to being able to add custom user modules on loader build, like if someone wants to add the extra Intel GPU ko in the tgz.

 

well it can be done before building via cli easily tho.

 

I'll re-add the download option, this way the user can add a custom addon that add the module

Link to comment
Share on other sites

4 hours ago, vbap said:

How would I re-install DSM using this tool? My system was working fine then made a network config error in DSM and now it won't get an IP.

Physical syno box can "reset" button to reset network settings. I think for xpenology we need to do a re-install.

 

Burn image, create the loader and re-install DSM keeping only the files.

Link to comment
Share on other sites

12 hours ago, pocopico said:


please use the platform specific tool chain, the bin utils are not the only issue. There are syno specific libraries that should be taken into consideration during build.

 

wrong binutils will result in unloadable modules, not using the toolchain will cause KPs and trouble in loading modules following the module after the last loaded. 
 

it’s easy and can be scripted like you did for the previous ones. Just extract the kernel in one stable directory and the tool chains in different directories. Then call different script function for each platform. 

Hum, then this can be my problem! Thanks again!

  • Like 1
Link to comment
Share on other sites

24 minutes ago, fbelavenuto said:

You can use the existing USB

I tried to build the loader again using existing USB, clear cache, even generating new serial, but nothing happens (the . So no way to do this from the menu? I have to burn the image again (even if to same USB)?

 

The system stays at this screen, showing new serial and has an IP, find.synology.com still detects the system with the old serial (and cant launch DSM).

image.thumb.png.d618672a7f559c0e2411bfbf93d36a99.png

Link to comment
Share on other sites

4 минуты назад, vbap сказал:

I tried to build the loader again using existing USB, clear cache, even generating new serial, but nothing happens (the . So no way to do this from the menu? I have to burn the image again (even if to same USB)?

 

The system stays at this screen, showing new serial and has an IP, find.synology.com still detects the system with the old serial (and cant launch DSM).

image.thumb.png.d618672a7f559c0e2411bfbf93d36a99.png

And before that DSM was launched?

Link to comment
Share on other sites

5 hours ago, pocopico said:

 

Actually, we were able to reach 30 ports. Read the below and a few posts after that.

 

 

SataPortMap values are neither decimal nor hex its based on ASCII values.(WTF? I know) 

 

@pocopico Awesome, I used the SataPortMap as 11H and it seems to find all my disks. As @Orphée mentioned though, it see the dummy 6 port controller and my onboard 6 port controller, then the 24 disks from the disk shelf - this makes DSM start at disk 13 (since the first 12 are detected but not being used). If there any way to have DSM just skip over those first 2 controllers entirely as I will not be using them at all? Ideally would want the first disk in my disk shelf to be registered as Disk 1 in DSM.

Link to comment
Share on other sites

17 minutes ago, jrac86 said:
 
@pocopico Awesome, I used the SataPortMap as 11H and it seems to find all my disks. As @Orphée mentioned though, it see the dummy 6 port controller and my onboard 6 port controller, then the 24 disks from the disk shelf - this makes DSM start at disk 13 (since the first 12 are detected but not being used). If there any way to have DSM just skip over those first 2 controllers entirely as I will not be using them at all? Ideally would want the first disk in my disk shelf to be registered as Disk 1 in DSM.

How did you set DiskIdxMap ?

 

It should be like :

DiskIdxMap=181900

Edited by Orphée
Link to comment
Share on other sites

46 minutes ago, SWAGG3R said:

And before that DSM was launched?

DSM was not launched since I stuffed up a network config in DSM (my fault).

 

The serial number in that screen shot is a newly generated SN, different to the one originally generated for the working DSM. 

 

I am happy to reinstall DSM, but wondering how to do this without burning arpl to the USB again. Can it be done from the menu.sh somehow? 

 

Link to comment
Share on other sites

4 минуты назад, vbap сказал:

DSM was not launched since I stuffed up a network config in DSM (my fault).

 

The serial number in that screen shot is a newly generated SN, different to the one originally generated for the working DSM. 

 

I am happy to reinstall DSM, but wondering how to do this without burning arpl to the USB again. Can it be done from the menu.sh somehow? 

 

for some reason, 3622xs+ didn’t work for me either, then I made a new bootloader with 920+ and everything started
Configuration H410i Asus, i3 10100

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...