{"id":23104780,"url":"https://github.com/mayniklas/openwrt-pi-cm4","last_synced_at":"2025-08-16T16:32:14.175Z","repository":{"id":194006015,"uuid":"580782511","full_name":"MayNiklas/openwrt-pi-cm4","owner":"MayNiklas","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-02T09:08:38.000Z","size":69,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-02T10:22:57.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/MayNiklas.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}},"created_at":"2022-12-21T12:42:56.000Z","updated_at":"2024-12-02T09:08:36.000Z","dependencies_parsed_at":"2024-12-02T10:21:49.029Z","dependency_job_id":"f0b76bf3-8a2a-4243-b6e2-680e36d7fd72","html_url":"https://github.com/MayNiklas/openwrt-pi-cm4","commit_stats":null,"previous_names":["mayniklas/openwrt-pi-cm4"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayNiklas%2Fopenwrt-pi-cm4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayNiklas%2Fopenwrt-pi-cm4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayNiklas%2Fopenwrt-pi-cm4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayNiklas%2Fopenwrt-pi-cm4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MayNiklas","download_url":"https://codeload.github.com/MayNiklas/openwrt-pi-cm4/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230044652,"owners_count":18164194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-17T00:36:19.675Z","updated_at":"2024-12-17T00:36:20.190Z","avatar_url":"https://github.com/MayNiklas.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenWrt for Raspberry Pi Compute Module 4\n\nI want to run OpenWrt on my travel router, based on a Raspberry Pi CM4 module.\nSince some drivers needed are not supported by OpenWrt, I need to build my own image from source.\nIt makes sense for me to build the image through a CI/CD pipeline, so I can easily update the image.\nAlso, other people might benefit from this aproach.\n\n## Hardware\n\n| Hardware                                                                                                               | link to shop                                                                                             | description                                                                  |\n| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |\n| [Raspberry Pi Compute Module 4](https://www.raspberrypi.com/products/compute-module-4/?variant=raspberry-pi-cm4002008) | [Berrybase](https://www.berrybase.de/raspberry-pi-compute-module-4-2gb-ram-8gb-flash?c=2410)             | Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz, 2GB RAM \u0026 8GB EMC storage |\n| [Waveshare CM4-DUAL-ETH-MINI](https://www.waveshare.com/wiki/CM4-DUAL-ETH-MINI)                                        | [Berrybase](https://www.berrybase.de/mini-ethernet-base-board-fuer-raspberry-pi-compute-module-4?c=2410) | A CM4 baseboard with dual Gigabit Ethernet ports                             |\n\n## Image building\n\nNote: When building locally, you need to have a few dependencies installed on your system.\nOn Ubuntu, you can install them with:\n\n```bash\nsudo apt install build-essential clang flex g++ gawk gcc-multilib gettext git libncurses5-dev libssl-dev python3-distutils rsync unzip gzip zlib1g-dev file wget\n```\n\nOn systems with [nix](https://nixos.org/download.html) installed, you can use the development shell to get a shell with all dependencies installed:\n\n```bash\nnix develop\n```\n\n`nix develop` is a flake command, so you need to have flake support enabled in your nix installation.\n\n### Prepare the OpenWrt source code\n\n```bash\n# pull submodules (feel free to update openwrt to a newer version)\ngit submodule update --init --recursive\n\n# copy diffconfig into the source code directory\ncp targets/Broadcom\\ BCM2711/diffconfig openwrt/.config\n\n# copy files into the source code directory\ncp -r files openwrt/\n\n# change into the source code directory\ncd openwrt\n\n# update \u0026 install feeds\n./scripts/feeds update -a\n./scripts/feeds install -a\n```\n\n### Use diffconfig to create .config\n\n```bash\n# expand diffconfig to full config\nmake defconfig\n```\n\n### Choose build options\n\n```bash\n# execute in OpenWrt root directory\nmake menuconfig\n```\n\n### Build images\n\n```bash\nmake -j$(nproc) download V=s\nmake -j$(nproc) V=s\n\nls -al bin/targets/*\n```\n\n## Build options I'm using for for OpenWRT\n\nI selected the following options for `Pi-CM4-DUAL-ETH-MINI.config`:\n\n### Target System\n\n- Target System -\u003e Broadcom BCM27xx\n- Subtarget -\u003e BCM2711\n- Target Images -\u003e tar.gz\n- Target Image -\u003e Kernel partition size (MiB): 128\n- Target Image -\u003e Root filesystem partition size (MiB): 896\n\n### Kernel modules\n\n- Kernel modules -\u003e Network Devices -\u003e kmod-r8169\n- Kernel modules -\u003e USB Support -\u003e kmod-usb2\n- Kernel modules -\u003e USB Support -\u003e kmod-usb2-pci\n- Kernel modules -\u003e USB Support -\u003e kmod-usb3\n\n### Luci\n\n- Luci -\u003e Collections -\u003e luci\n- Luci -\u003e Modules -\u003e Translations -\u003e German (de)\n- Luci -\u003e Modules -\u003e Translations -\u003e English (en)\n- Luci -\u003e Modules -\u003e Translations -\u003e Spanish (es)\n- Luci -\u003e Modules -\u003e Translations -\u003e French (fr)\n\n### VPN support\n\n- Luci -\u003e Applications -\u003e luci-app-openvpn\n- Luci -\u003e Applications -\u003e luci-app-wireguard\n- Luci -\u003e Protocols -\u003e luci-proto-wireguard\n- Network -\u003e VPN -\u003e openvpn-openssl\n- Network -\u003e VPN -\u003e wireguard-tools\n- Utilities -\u003e openssl-util\n\n### [Smartphone USB tethering](https://openwrt.org/docs/guide-user/network/wan/smartphone.usb.tethering)\n\n- Kernel modules -\u003e USB Support -\u003e kmod-usb-core\n- Kernel modules -\u003e USB Support -\u003e kmod-usb-net\n- Kernel modules -\u003e USB Support -\u003e kmod-usb-net-cdc-eem\n- Kernel modules -\u003e USB Support -\u003e kmod-usb-net-cdc-ether\n- Kernel modules -\u003e USB Support -\u003e kmod-usb-net-cdc-ncm\n- Kernel modules -\u003e USB Support -\u003e kmod-usb-net-cdc-subset\n- Kernel modules -\u003e USB Support -\u003e kmod-usb-net-huawei-cdc-ncm\n- Kernel modules -\u003e USB Support -\u003e kmod-usb-net-ipheth\n- Kernel modules -\u003e USB Support -\u003e kmod-usb-net-rndis\n- Kernel modules -\u003e native Language Support -\u003e kmod-nls-base\n- Libaries -\u003e libimobiledevice -\u003e libimobiledevice\n- Utilities -\u003e libimobiledevice -\u003e usbmuxd\n- Utilities -\u003e usbutils\n\n## Copy config files into this repository\n\n```bash\n# convert .config to diffconfig\n./scripts/diffconfig.sh \u003e diffconfig\n\n# copy diffconfig \u0026 .config into this repository\ncp diffconfig .config ../targets/Broadcom\\ BCM2711/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayniklas%2Fopenwrt-pi-cm4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmayniklas%2Fopenwrt-pi-cm4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayniklas%2Fopenwrt-pi-cm4/lists"}