Post
# Building TollGate Our build pipeline is still undergoing change, but things need to stabilise and become easy for developers (like you) to use. Your feedback and pull requests are most welcome. ### How does OpenWRT manage packages? OpenWRT uses a package manager called `opkg` to install packages (`.ipk` files), which are compiled to from `Makefiles`. When you build OpenWRT, it clones a [`feeds.conf`](github.com/openwrt/openwrt/blob/main/feeds.conf.default) file containing all the required dependencies. You can include a link to your own [custom feed](github.com/OpenTollGate/custom-nostr-feed) which contains `Makefiles` that download your repositories of your custom packages into the OpenWRT directory so that they can be build along with the rest of the operating system. > [!NOTE] > Beware, compiling with the full buildroot does everything from scratch, every time you want to try your custom program. You may want to avoid this when making frequent changes to the packages in your custom feed. > > This takes too long, (almost) no-one has that much time for freedom.. ### Using the SDK Fortunately, there is something called an SDK, which is essentially a simplified buildroot containing a stripped down version of the OpenWRT source tree. The SDK contains: • Compiler toolchains and libraries (precompiled) • Scripts and makefiles to handle package configuration and compilation Since the compiler and most dependencies are already built when you use the SDK, you only compile your custom feeds or packages. Now we can just [download & unpack](github.com/OpenTollGate/tollgate-sdk/blob/71e37959c3e0d4a4ef9c8d053f9d9fdb72a797cb/build-firmware#L141-L148) the SDK, [place our custom feeds](github.com/OpenTollGate/tollgate-sdk/blob/71e37959c3e0d4a4ef9c8d053f9d9fdb72a797cb/build-firmware#L156-L162), use `make defconfig` to create a configuration file and `make package/[our_package]/compile` to compile the individual packages. Once we have our packages, we upload them to blossom servers and create a nostr event listing the binaries we uploaded, the servers that they can be found on and the commit hashes of the repositories that the packages were compiled from. Now that we have our packages on blossom servers, routers can just listen for signed nostr events announcing compatible updates, download the packages and install them using the OpenWRT package manager. Disclaimer: we need you to make this client. > [!Your Turn] > [Here](
### Using the SDK in practice Earlier we explained the ins and outs of building packages and images for OpenWRT. Now lets actually build a package rather than just talking about it. ##### Lets clone the SDK ``` git clone github.com/OpenTollGate/tollgate-sdk.git ``` ##### Lets install a tool to interact with blossom servers ``` ./blossofiles.v0l.io/", "nostr.download/", "blossom.poster.place/" ], "relays": [ "wss://orangesync.tech", "wss://nosgithub.com/OpenTollGate/tollgate-module-relay-go/blob/main/src/go.mod) * compiles the remaining custom feeds > [!Patience] > Even thfranzap has advice on how we can improve this workflow. ``` { "binarfiles.v0l.io/", "nostr.download/", "blossom.poster.place/" ] }, "golang-src_1.23.4-1_files.v0l.io/", "nostr.download/", "blossom.poster.place/" ] }, files.v0l.io/", "nostr.download/", blossom.poster.place/" ]files.v0l.io/", nostr.download/", blossom.poster.place/" ]files.v0l.io/", nostr.download/", blossom.poster.place/" ]files.v0l.io/", nostr.download/", blossom.poster.place/" ]
... show more
) are some practical details for those who actually want to do it. ### Using the image-builder Another option is to use the image-builder to download a pre-defined list of packages and [install them](github.com/OpenTollGate/tollgate-image-builder/blob/d4d48ea0df756b3c25aeb0b77201c242a1a789aa/build-firmware#L257-L268) in an OpenWRT image. We can also place configuration files that we need in the image's filesystem, which could be more reliable (declarative) than modifying configuration files using the install section of a package's `Makefile`. Now we have an OpenWRT image that we can copy to the router using `scp` and install with `sysupgrade -n [image_name].bin`. > [!Your Turn] > [Here](
### Using the image-builder in practice Earlier we explained the ins and outs of building packages and images for OpenWRT. Now lets actually build a package rather than just talking about it. ##### Lets clone the image-builder ``` git clone github.com/OpenTollGate/tollgate-image-builder.git ``` ##### Lets install a tool to interact with blossom seraw.githubusercontent.com/OpenTollGate/tollgate-sdk/refs/heads/main/blossom-installer.sh | sudo bash ``` ##### Lets install a python library for ifiles.v0l.io/", "nostr.download/", "blossom.poster.place/" ], "relays": [ "wss://orangesync.tegithub.com/OpenTollGate/tollgate-image-builder/blob/d4d48ea0df756b3c25aeb0b77201c242a1a789aa/build-firmware#L244-L246) from blossom * [installs all the packages](github.com/OpenTollGate/tollgate-image-builder/blob/d4d48ea0df756b3c25aeb0b77201c242a1a789aa/build-firmware#L267-L275) franzap
:09:
:09:
... show more
) are some practical details for those who actually want to do it. ### Outlook - runners in gitworkshop.dev We want to create git actions for the tool that compiles packages with the SDK and the tool that installs these packages into an OpenWRT image so that we can tap into stranded compute in order to iterate more quickly. Fortunately there is this awesome tool called `ngit`, which creates nostr events for our `git` commits and enables us to use nostr to create `issues` and `pull requests`. Fortunately Arjen is integrating an open-source runner for git actions with gitworkshop so that `npubs` can stack SATs by running your git actions for you. ### Something is missing, wrong or outdated? Lets fix it. Make a pull request, DM the maintainers, edit the event. We need you!
Thanks to #SovEng for creating the conditions for this to happen. Please [join us](sovereignengineering.typeform.com/SEC-04?typeform-source=sovereignengineering.io) in Madeira if you want to help. #TollGate
0
0