Coder Social home page Coder Social logo

fabianishere / udm-kernel Goto Github PK

View Code? Open in Web Editor NEW
123.0 15.0 9.0 1.47 GB

Custom Linux kernels for the UniFi Dream Machine

Home Page: https://github.com/fabianishere/udm-kernel-tools

License: Other

Makefile 0.25% C 97.90% Assembly 1.32% C++ 0.03% Shell 0.14% Perl 0.19% Awk 0.01% sed 0.01% Python 0.09% Yacc 0.02% Lex 0.01% UnrealScript 0.01% SmPL 0.02% Gherkin 0.01% XS 0.01% Raku 0.01% Roff 0.02% Clojure 0.01% M4 0.01%
udm-pro ubiquiti unifi linux kernel udm

udm-kernel's Introduction

udm-kernel

Custom Linux kernels for the UniFi Dream Machine (Pro) based on the UbiOS stock kernel.

See udm-kernel-tools for instructions on how to run these kernels on your device.

Flavours

This repository offers several kernel flavours for the UniFi Dream Machine (Pro):

Stock

The sources for the stock kernel running on the UDM/P is located at the flavour/stock branch.

We do not offer any pre-built kernels for stock kernels. However, the stock kernel provides the base upon which the other kernel flavours build.

Edge

The edge flavour is located at the master branch and extends the stock kernel with more functionality. In particular, we extend the stock flavour kernel the following features:

  1. Multicast routing
  2. Multipath routing
  3. In-kernel WireGuard VPN support
  4. IP-VLAN, VXLAN and MAC-VLAN tap driver support
  5. CAKE QoS support

The edge flavour targets the most common use-cases for running a custom kernel, but should not behave differently from the stock kernel in default configuration.

Pre-built kernels are available on the Releases page (suffixed with -edge).

Installation

SSH into your UniFi Dream Machine and enter the UniFi OS shell as follows:

unifi-os shell

Select from the Releases page the kernel version you want to install and download the appropriate Debian package. Then, you can install the package as follows:

apt install ./udm-kernel-VERSION-RELEASE_arm64.deb

Important
To actually use these kernels, please visit udm-kernel-tools for instructions.

Contributing

Feel free to open a issue or pull request to this repository if you have a question, suggestion or want to add new functionality to the custom kernels.

If you are adding new functionality to the kernel, please motivate your use-case and think about how it might be useful for other users as well.

Build Process

Prerequisites

Make sure you have the following packages installed:

apt install build-dep libncurses-dev gawk flex bison openssl libssl-dev gcc-aarch64-linux-gnu

It might be that case that more recent versions of GCC have difficulty compiling the kernel without warnings or issues. The pre-built kernels in this repository are built on Ubuntu 18.04 using GCC 7.5.0.

Obtaining the source

Obtain the kernel sources from Github as follows:

git clone https://github.com/fabianishere/udm-kernel
cd udm-kernel

Building

First, prepare the configuration for the kernel. Beforehand, you may add the desired kernel configuration options to .github/config/config.local.udm.

.github/prepare.sh

If you wish to graphically configure the kernel options, pass the -m flag:

.github/prepare.sh -m

Make sure CONFIG_MODULE_FORCE_LOAD is always enabled, in order for the kernel to boot properly.

Once the kernel is configured, build the kernel as follows:

.github/build.sh

Afterwards, you will find the generated Debian packages in the directory above the repository.

udm-kernel's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

udm-kernel's Issues

Device Request UCKP

Dear all,
I found this repo here and like to ask if ubnt provide kernel sdk packagades and where to find these?
We have some unifi cloud keys gen2 pro.

At this running chrooted 3.18.44-ui-qcom kernel.

Some things we like to use like wireguard or zfs need kernel modules, so could it possible to create a own new kernel with kernel headers?

best Regards

Install custom kernel

I think i did something wrong but i didn't know what. I have trouble installing the custom config. You can see my steps in the discription. What did i do wrong?

image

Does Smart Queues setting needs to be enabled to use CAKE?

Hey, sorry if this is obvious but as the title says, Does the Smart Queues setting in the unifi config needs to be enabled to use CAKE? Is there some other switch that needs to be flipped on the command line ?

Thanks for this btw!

Enabling CONFIG_NETFILTER_XT_TARGET_HL

Hello just found this project and am still getting familiar with it. Would it be possible to enable CONFIG_NETFILTER_XT_TARGET_HL option in the kernel? The stock kernel on UDM Pro has this disabled.

Thanks

Adoption fails?

Hey @fabianishere ,

I installed the kernel and was able to get BGP multipath routing working - yay!

However, overnight my devices all rebooted after an upgrade and entered a repeated failed adoption loop. Truee the usual set-inform and reboots, but nothing helped.

After reverting to the stock kernel and rebooting, adoption worked on the whole network again.

Any thoughts? Ideally I need both the multipath but also my fleet to stay up ๐Ÿ˜„

Kernel for 1.12.30?

1.12.30 has been out for a while I believe. Any plans for providing a corresponding custom kernel? Or is the kernel unchanged between 1.12.22 and 1.12.30?

Kernel source origin

Just a general question. Where did this kernel source code come from? It does not line up with mainstream 4.19 Linux source. Is there an official kernel source provided by Ubiquiti?

Wireguard non-functional

Hey there, I've had edge3 installed for some time now on my UDM Pro. Over the last weeks, my UDM auto updated to 1.11.4 firmware (which I thought I disabled? too late now lol). The first thing I went about doing was figuring out why my multipath routing wasn't working anymore and come to find that the routes are being rejected, which led me to believe I was back on stock kernel. Sure enough. So, I rebooted into edge3 with the newest udm-kernel-tools package and I have multipath routing back! Yay!

However, since this reboot wireguard has been totally non-functional. I get this when attempting to bring up the wg0 interface:

Warning: `/mnt/data/wireguard/etc/wireguard/wg0.conf' is world accessible
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.10.10.2 dev wg0
[#] ip link set mtu 1420 up dev wg0
Error: mtu less than device minimum.
[#] ip link delete dev wg0

After tons of trying, I rebooted back into the stock kernel and tried to use the wireguard-kmod utility again. It loaded the kernel modules in there and functions great, but I then have no multipathing.

This worked right up until the auto update to v1.11.4. Is there any reason this could now be broken for me?

For reference, the stock kernel is: 4.19.152-al-linux-v10.2.0-v1.11.4.3940-e66d85f

Safe to upgrade to 1.11.4?

Not an issue, so apologies for using this channel for this query but is it safe to go to 1.11.4?

Running 1.11.0 at the moment.

custom kernel installation

hi there
i have this issue when I tried to install a custom kernel
unifi-os shell
apt install ./udm-kernel-4.19.152-edge4_4.19.152-edge4-1_arm64.deb

E: Unsupported file ./udm-kernel-4.19.152-edge4_4.19.152-edge4-1_arm64.deb given on commandline

the udm-kernel-tools is installed already
any suggestions thanks

Where is WireGuard

Hello,

I've installed the latest pre-built kernel and it loads on boot.

root@ubnt:/# uname -a
Linux ubnt 4.19.152-edge3 #1 SMP Wed Dec 22 09:14:38 UTC 2021 aarch64 GNU/Linux

I was under the impression that WireGuard was included in this kernel. I'm not quite sure how to start WireGuard and run it in-kernel. I'm not quite sure what my next step is, can someone give me some pointers?

(The end goal is a split vpn for one client.)

Help for a newbie

I received the v1.11.10-23 GPL archive from Ubiquiti, but I think what I was expecting to receive was something that made a bit more sense to me...

The archive has:

buildroot.config
host-manifest.csv
manifest.csv

and four folders:

host-licenses/
host-sources/
licenses/
sources/

inside each of the sources folder are module / dependencies with patches, and the src.tar for each of those modules. For example:

sources/alsa-lib-1.1.5/
  - alsa-lib-1.1.5.tar.bz2
  - 0001-no-mmu.patch
  - 0002-dlmisc.patch
  - 0003-conditional-enabling-of-libdl-in-m4.patch
  - series (appears to be a list of the patches for this module)

How does one untangle what differences are pertinent between the previous version committed to this repo, versus what I received?

If it seems like I'm way too much of a newbie, I won't be offended if you let me know that ;) I would love to learn though.

Did you consider a branch without WireGuard

Hi Fabian, thank you very much for this UDM work. Like so many others I'm really missing the igmpproxy to be able to have IPTV running.
Did you consider having a branch with the kernel with just that difference and without WireGuard?
Thanks in advance for your time!

UDM SE

Hey there, I love the work you've done on creating custom kernels for the UDM(Pro). However, I have a Unifi Dream Machine Special Edition. As far as I can tell from my limited research, the UDM SE is basically just a Debian linux box that's been configured as an appliance. Out of the box, it doesn't run containers like the UDM and UDM Pro do. It appears to run Unifi OS directly and runs the applications natively, installing them from .deb packages. Anyway, I need to compile the xt_HL.ko module for it which adds the TTL netfilter target, because I need to modify the TTL on my backup internet connection. I was able to obtain the GPL archive from ubiquiti for the 2.4.9 firmware. I attempted to use this repo to build a new kernel, but when I extracted the module from the created .deb archive, copied it to the UDM SE, and tried to load it, all I get is insmod: ERROR: could not insert module xt_HL.ko: Invalid module format. Any ideas on how to properly build this module? Can I just build the module itself or do I have to build a full kernel and load it?

Which kernel with 1.10.4 or 1.11?

I was just trying to run a custom kernel on 1.11 because I needed multi-path. As I was told that the latest custom kernel would be incompatible, I downgraded to 1.10.4 - and got the same response.

Is there a way for me to build a compatible kernel for 1.11 myself? What would be the right OS version for the latest edge kernel provided for download here?

Thanks

broken UDM - repair options

Hi,
I would really like to beg for your help, I am all out of ideas!

I have a UDMP that cannot find its kernel image and i want to flash this one.
However I only have access to u-boot on the device via JTAG serial.

U boot reports it cant find the USB, XHCI Controller, Network or anything. The guy i got it off said it went like this during a failed firmware update.
My gut says that if I can get a clean install of uboot for my device it will re-load all the hardware.

Is there any chance you can dump the u-boot firmware for me from your UDMP? I found a procedure on youtube...my issue is i dont know anyone with a UDMP that they have cracked open...
I can then flash it on and try to load your Kernel once it can get back to the USB?

Details from my u-boot output, attached full dump,
u-boot2.txt

Really appreciate your help in advance! :)

SF: Detected MX25U6435F with page size 256 Bytes, erase size 4 KiB, total 8 MiB
U-Boot script not found in TOC!
Board config ID: alpine_v2_ubnt udm-pro v6.0, 113-723-10
Trace disabled
Found thermal sensor : adt7475_thermal
Temp 0 : 22 C
Temp 1 : 24 C
Temp 2 : 24 C
NAND: 0 MiB
SF: Detected MX25U6435F with page size 256 Bytes, erase size 4 KiB, total 8 MiB

Edge kernel for v1.12.33

I was in the middle of patching udm-kernel-tools for v1.12.33 when I realised the UDM_COMMIT line in the config.mk file refers to the specific rebased commit here. Not entirely sure how to go about the rebasing process for the v1.12.33 kernel (haven't emailed Ubiquiti yet either), so I thought I'd raise it here instead for assistance/guidance

Hopefully this is the last one on the UniFi OS 1.0 line and we can start working on this for the UniFi OS 2.0/3.0 lines soon

Edge Kernel for new UnifiOS 1.12.30

Hi @fabianishere, may I check if there is any plan for a new kernel release which is compatible with UnifiOS 1.12.30? My UDM is in that version, and I am unable to boot 4.19.152-edge4.
Attaching the error message that I am receiving,

root@ubnt:/# udm-bootctl boot 4.19.152-edge4
Loading kernel 4.19.152-edge4...
Inserting kexec kernel modules...
Kernel version not supported (v1.12.30)
Make sure you have installed the latest version of udm-kernel-tools...

Or is there an alternative to downgrade my UnifiOS so that I can install the above kernel?

Kernel preparation fails

If you add the file .github/config/config.local.udm the prepare.sh fails too make a good .config
Must add -m to the line for config.local.udm Then everything works as expected
....

Support local options

if [ -f .github/config/config.local.udm ]; then
scripts/kconfig/merge_config.sh -m .config .github/config/config.local.udm
CONFIG_FILES="$CONFIG_FILES .github/config/config.local.udm"
fi

USW-Pro-24-POE and U6-LR not adoptable

So I decided to give this a go for the first time after discovering it today. I am pretty good with SSH and Linux so getting it going was a breeze.

What wasn't was that my Switch and AP were no longer Adopted. Even after resetting the devices via SSH and button on the hardware.

Is this expected behavior? If not any ideas what may have caused this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.