synology-wireguard icon indicating copy to clipboard operation
synology-wireguard copied to clipboard

Support for Synology Router SRM

Open KibaNoOu opened this issue 5 years ago • 4 comments

Hi Andreas, your work is really great! But it would be even more useful if you could somehow create a .spk for SRM as well.

Best regards, Keep up the good work!

KibaNoOu avatar Aug 29 '19 09:08 KibaNoOu

Hi Kiba's King,

Unfortunately I won't be able to do that since I don't own an SRM router. I don't even know how to build SPKs for them (https://github.com/SynologyOpenSource/pkgscripts-ng that I use only support DSM as far as I know).

If someone wants to do this and have questions I may be able to aid them. If someone wants help with this I am open for PRs.

runfalk avatar Aug 29 '19 11:08 runfalk

@runfalk SRM is "just" another target for Synology packages. Specifically, three different targets, due to the different architecture of the SoCs in the three different routers (northstarplus would be the old RT1900ac, ipq806x is the RT2600ac, and dakota or ipq4019 is the MR2200ac).

Versions are also different, currently SRM is on 1.2.3 (toolkit is for 1.2.x).

Based on my quick read-through of the repo you linked, it should be relatively simple to add the SRM targets to EnvDeploy, though some small parts need to change (the URL won't match their current scheme). I've opened a ticket for that.

Otherwise, SRM targets are practically the same as DSM, so once the scripts are updated to support it, you should be able to do so as well. You'll need to change SynoBuildConf/depends though.

Or if you're feeling adventurous, you could try manually establishing the build environment, following the EnvDeploy script's steps:

  • Create a new folder for your chroot - {script_source}/build_env/ds.{platform}-{version}/
  • Download the required files:
    • [ ] base_env
    • [ ] env (note: URL is NOT valid, you need to replace {platform} and {version} with the appropriate values!)
    • [ ] dev
  • Extract the above files in the above folder, in the above order
  • Initialise chroot This is a lengthy step, and not exactly nice doing manually. The ToolkitDeployer part of the EnvDeploy script goes through it in detail, though. A quick list would be:
    • [ ] Create a source directory in the main chroot folder ({script_source}/build_env/ds.{platform}-{version}/source
    • [ ] Link Python 2.x as main Python
    • [ ] Copy some config files from the host system: /etc/hosts, /root/.gitconfig, /root/.ssh, /etc/resolv.conf)
    • [ ] Symlink the pkgscripts-ng folder into the chroot folder
  • Enter chroot You'll most likely need to mount /proc and maybe even /dev before you do this, but that should be fairly obvious
  • Build away

fonix232 avatar Jun 03 '20 07:06 fonix232

Looks like someone already picked it up, albeit using spksrc (which to me looks like a much easier to use build system for SPKs): https://github.com/publicarray/spksrc (check wireguard branch).

fonix232 avatar Jun 04 '20 09:06 fonix232

Nice research! Seems like the commits are quite old and probably would require some serious work to get going. I'd definitely use spksrc if I did this project from scratch, so if someone wants to do a PR for that knock yourself out.

Unfortunately I don't think Synology monitors issues in that repository so it'll probably never be fixed.

runfalk avatar Jun 04 '20 10:06 runfalk