{"id":51241188,"url":"https://github.com/telnetdoogie/synology-kernelmodules","last_synced_at":"2026-06-29T00:30:37.110Z","repository":{"id":280614137,"uuid":"942576887","full_name":"telnetdoogie/synology-kernelmodules","owner":"telnetdoogie","description":"Extensible method of compiling kernel modules for Synology NAS","archived":false,"fork":false,"pushed_at":"2026-06-05T16:55:29.000Z","size":5831,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-06-05T18:47:38.843Z","etag":null,"topics":["customization","docker","kernel","kernel-module","synology","synology-dsm"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/telnetdoogie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-04T10:22:47.000Z","updated_at":"2026-06-05T16:55:30.000Z","dependencies_parsed_at":"2026-03-09T19:04:18.537Z","dependency_job_id":null,"html_url":"https://github.com/telnetdoogie/synology-kernelmodules","commit_stats":null,"previous_names":["telnetdoogie/synology-kernelmodules"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/telnetdoogie/synology-kernelmodules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telnetdoogie%2Fsynology-kernelmodules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telnetdoogie%2Fsynology-kernelmodules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telnetdoogie%2Fsynology-kernelmodules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telnetdoogie%2Fsynology-kernelmodules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telnetdoogie","download_url":"https://codeload.github.com/telnetdoogie/synology-kernelmodules/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telnetdoogie%2Fsynology-kernelmodules/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34909137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["customization","docker","kernel","kernel-module","synology","synology-dsm"],"created_at":"2026-06-29T00:30:34.704Z","updated_at":"2026-06-29T00:30:37.069Z","avatar_url":"https://github.com/telnetdoogie.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compiling Optional Kernel Modules for Synology\n## (Primarily motivated by docker v28 requiring iptables_raw modules) - but could be extended and used for other things.\n\n------------------\n\n## Using Docker\n\nI am just using docker now which automates all the above. All you have to pass is the platform name, like `apollolake` or `geminilake`\n\n* mapping a volume like the below will automatically pull the created modules out of the build onto the host for publishing.\n\n| :warning: I strongly advise you DO NOT run this in a container on your NAS as the host. The toolkit specifically advises against that, and I think given what it does with `/proc` it might not be a great idea. |\n| --- |\n\n```\ndocker build -t compile_modules .\ndocker run --privileged --rm -v ./compiled_modules:/compiled_modules:rw -e PLATFORM=apollolake compile_modules\n```\n\n## Experimental - Legacy builds\n\nI've been attempting to build for older kernels, as yet unsuccessfully, but I leave a trail here lest someone can continue and make it work\nI have made a 'legacy' Dockerfile for these older builds, where older compilers and OSes are required nmaybe.\n\n```\ndocker build -t compile_modules_legacy ./Dockerfile_legacy\ndocker run --privileged --rm -v ./compiled_modules:/compiled_modules:rw -e PLATFORM=avoton compile_modules_legacy\n```\n\n#### Once run for your platform, your modules should be available in the appropriate folders for copying to your synology. Given the above setup, they're in (for example):\n * `compiled_modules/4.4.302+/apollolake/iptable_raw.ko`\n * `compiled_modules/4.4.302+/apollolake/ip6table_raw.ko`\n\n#### If you're on a linux box or have WSL, you can check the details of the mod by running, for example:\n * `sudo modinfo net/ipv4/netfilter/iptable_raw.ko` - The `vermagic` line has to match the kernel version of your NAS precisely (including the `+` suffix):\n```\nfilename:       net/ipv4/netfilter/iptable_raw.ko\nlicense:        GPL\ndepends:        ip_tables\nretpoline:      Y\nvermagic:       4.4.302+ SMP mod_unload\n```\n\n#### You can now copy these files to your NAS in `/lib/modules`\n\n#### Change the permissions and ownership of the new `.ko` files on the NAS:\n```\nsudo chown root:root /lib/modules/{iptable_raw.ko,ip6table_raw.ko}\nsudo chmod 644 /lib/modules/{iptable_raw.ko,ip6table_raw.ko}\n```\n\n#### Load the modules one time:\n```\nsudo insmod /lib/modules/ip6table_raw.ko\nsudo insmod /lib/modules/iptable_raw.ko\n```\n\n#### Assuming you received no errors, validate they're loaded:\n```\n$ sudo lsmod | grep raw\niptable_raw             1452  0\nip6table_raw            1456  0\nip6_tables             14933  14 ip6table_filter,ip6table_raw\nip_tables              14342  4 iptable_filter,iptable_mangle,iptable_nat,iptable_raw\nx_tables               17395  24 ip6table_filter,xt_ipvs,xt_iprange,xt_mark,xt_recent,ip_tables,xt_tcpudp,ipt_MASQUERADE,xt_geoip,xt_limit,xt_state,xt_conntrack,xt_LOG,xt_mac,xt_nat,xt_set,xt_multiport,iptable_filter,ip6table_raw,xt_REDIRECT,iptable_mangle,ip6_tables,xt_addrtype,iptable_raw\n```\n\n#### If you want to load the libraries on startup, add the `insmod` lines from above to a Scheduled Task, running as `root` on boot, or add to a service that is loading modules on startup.\n\n\n---\n\n\n## If you want to modify this...\n\n`entrypoint.sh` is where everything happens. If you include additional files be sure to modify the Dockerfile to copy them into the container on build.\nCurrently, `entrypoint.sh` reads the `PLATFORM` value that's passed in, and uses that to set up the DSM toolchain which downloads the cross-compiler and sets the environment up for build.\n\n`apply_patches.sh` gets called from `entrypoint.sh` before compilation, in case any modifications are needed to config or source.\n\nOnce module compilations are complete, compiled modules are copied out to the `/compiled_modules` folder\n\nSo... if you want to make significant changes to this, `entrypoint.sh` is the place to start. \n\nThe way this is set up currently (the way I run it, with `--rm`) the container is stateless so DSM toolchain downloads etc happen anew each time.\n\nHappy tinkering! PRs welcome!\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelnetdoogie%2Fsynology-kernelmodules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelnetdoogie%2Fsynology-kernelmodules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelnetdoogie%2Fsynology-kernelmodules/lists"}