Commit graph

1145 commits

Author SHA1 Message Date
Raito Bezarius
ebcdbf76bc fix(bridge): members are now granular services
They are still part of the bundle, but we can wait on each of them
independently now.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-05 14:54:12 +02:00
Raito Bezarius
78d0088b65 ubus: build with Lua
Some checks failed
build liminix / build_vm_qemu_mips (push) Failing after 27s
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-04 16:30:44 +02:00
Raito Bezarius
6d4237ff87 libubox: build with Lua
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-04 16:29:59 +02:00
Raito Bezarius
c24c659ee1 modules/ubus: init
Some checks failed
build liminix / build_vm_qemu_mips (push) Failing after 27s
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-04 16:08:56 +02:00
Raito Bezarius
4287a05182 ubus: init at unstable-04-09-2024
Some checks failed
build liminix / build_vm_qemu_mips (push) Failing after 28s
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-04 15:53:26 +02:00
Raito Bezarius
eb083bee20 libubox: init at unstable-04-09-2024
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-04 15:53:19 +02:00
Raito Bezarius
1bd9af1e9d fix(bridge): reorder initialization for bridge dependents
Some checks failed
build liminix / build_vm_qemu_mips (push) Failing after 27s
Consider the scenario where you run DHCPv4 on the primary bridge
interface.

You have no real interface to "wait upon", so it's OK. Nonetheless,
anything depending on successful completion of DHCPv4, e.g. adding a
default route, will block `s6-rc -v2 up change default`.

The way new interfaces are attached to the bridge is via `s6-rc -b -u
change $attach-oneshot-service`, this introduce in turn a deadlock.

At some point, DHCPv4 will timeout, unblocking the deadlock and
attaching the members to the primary bridge interface, making it ready
to send L2 broadcast packets for DHCP, unblocking DHCP in turn again.

This is not satisfying because we really want to have a no-hiccups
bring-up.

To fix this, we proceed to multiple changes:

- we remove `svc.ifwait.build` out of band `s6-rc -b -u $oneshot-attach`
  call, which is, by design, wrong here.
- users can now depend on the members service to know when a bridge is
  fully operational (we could make it more granular and let them depend
  on the LAN member joining rather than WLAN, etc.)
- users can also depend on the primary service being brought up rather
  than just being present, this is useful if you need to bring it up
  when it has AT LEAST one member to get link local address or MAC
  addresses (fixing DHCPv6 bring up as well because `ff02::1` is used
  there).

One thing is not addressed yet, if you are running a WLAN service using
RADIUS attached to the bridge, at bring up time, it will try to reach
out the external RADIUS server and *fail*.

To solve this, granular dependency on the DHCPv4 once LAN is joined.
Then the hostapd can wait on defaultroute4 completion so that
connectivity is available to reach RADIUS server.

It can join the bridge later on without any hiccup as well.

This is left as a TODO as hostapd can survive RADIUS authentication
failure and retry later.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 18:15:28 +02:00
Raito Bezarius
21ff11503e fix(bridge): pick up MAC from another interface
This avoids the OPERSTATE unknown when the bridge is brought up but the
members are not ready yet.

This will make OPERSTATE to down, enabling us to wait until we have
brought up completely all the members.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
f0b4e826cb fix(ifwait): match over strings and not symbols
Are they the same in Fennel?

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
ca9642a61e fix(ifwait): return :present if newlink is up/yes
Urgh…

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
1d0fc24111 fix(bridge/members): log attach/detach
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Daniel Barlow
36f3015acd dhcpc handle case when env vars are missing
the notify-script should continue and signal readiness even if one or
more of the outputs it writes are mssing in the environment
2024-09-01 17:48:54 +02:00
Raito Bezarius
664624a478 feat(jitterentropy): introduce a jitterentropy module
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
f34a63d1c8 feat(pki): init TLS PKI module
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
eaa8c089a8 feat(mtd-utils): save more space
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
3d528a71e9 feat(hostapd): make the package configurable to enable RADIUS
The default hostapd disable too many things, we need a bit more for
RADIUS.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
17355c3911 fix(preinit): scan multiple times the cmdline and rename altroot in rootalt
The way the parsing works is examining one character at a time.

First, if we had `rootfstype=... root=...`, the parsing would jump and
ignore `root=...`, which sucks.

To fix this, we scan multiple times a copy of the cmdline.

Now, we have a new problem: `root=... altroot=...` lead to opts.device
being equal to the altroot as we are looking one char at a time, so we
will arrive at a moment looking at `root=...` for `altroot=...`.

To avoid this, we rename `altroot` in `rootalt`, cheap, I know.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
c1e61d6af5 fix(zyxel/nwa50ax): ubi cannot run on phram
Discovered the hard way.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
85bfe94429 fix(zyxel/nwa50ax): ensure the DTB is in the FIT
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
ea740bbfaf fix(zyxel/nwa50ax): make altroot useful
Let's use `ubi1` if it exist, as it should be the second device
containing a rootfs.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
8f5ea94765 chore(zyxel/nwa50ax): write flash erase block size as kb size
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
86e81efbd6 tftp: introduce an alternative command line for TFTP
Normal command line and TFTP command line can be sometimes very
different.

e.g. We don't want to load UBI filesystems for a TFTP boot as it may
interfere with our root device loading.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Raito Bezarius
2d6414ea41 tftp: introduce the FIT enclosing boot.scr
This simplify TFTP.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
65de896019
feat(ci): build VM QEMU MIPS
All checks were successful
build liminix / build_vm_qemu_mips (pull_request) Successful in 31s
build liminix / build_vm_qemu_mips (push) Successful in 30s
2024-08-27 11:05:43 +02:00
Raito Bezarius
afe9d2211b outputs/vmroot: use the build runtime shell
otherwise, this will use the cross runtime shell, which is wrong!

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-08-25 19:07:42 +02:00
Raito Bezarius
092e9f5524 pkgs/run-liminix-vm: use build packages
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-08-25 18:44:44 +02:00
Raito Bezarius
385ebea57d examples/hello-from-qemu: add platforms
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-08-25 18:44:23 +02:00
Raito Bezarius
0813d09fde fix(overlay): remove the weird lua_no_readline overlay
It's not a proper overlay because it breaks the splicing for luaOnBuild
and therefore breaks the rest.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-08-23 21:55:49 +02:00
Raito Bezarius
46217b24a3 fix(modules/hardware): default for ubi.mtds is []
Otherwise, evaluation error for anything not using it.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-08-23 19:37:43 +02:00
Raito Bezarius
597fbc168e fix(default): add overlay via nixos module system
For some reason, the overlays are discarded when the package set gets
re-evaluated.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-08-23 19:36:34 +02:00
Raito Bezarius
ccd5c3b0b1 examples(qemu): add mipsel-linux as host platform
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-08-23 19:36:12 +02:00
Raito Bezarius
7206fea4b4 fix(nixpkgs): drop meta.*
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-05-24 19:00:29 +02:00
Raito Bezarius
561d47822a fix(assertions): wire up the assertion system
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-05-24 19:00:04 +02:00
Raito Bezarius
8a6709e91b fix(nixpkgs): drop nixpkgs.initialSystem
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-05-24 18:54:16 +02:00
7ae86c23d9 Merge pull request 'external: initialize machinery for external interop' (#5) from colmena--compat into main
Reviewed-on: #5
2024-05-24 17:36:05 +02:00
Raito Bezarius
081b9ab370 feat(modules): add a nixpkgs module
Like nixpkgs itself, we can control Liminix's package set via the module
system.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-05-24 17:36:05 +02:00
Raito Bezarius
258c33f409 feat(entrypoint): expose evalModules for external interop
e.g. colmena can make use of it to declare an heterogeneous set of
systems, mixing Liminix and NixOS systems.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-05-24 17:36:05 +02:00
Daniel Barlow
00a99d16b5 make a serviceDefn for wwan 2024-05-24 17:23:27 +02:00
Daniel Barlow
c3d6c55a74 commentary 2024-05-24 17:23:27 +02:00
Daniel Barlow
fa7fde87db add hacky wwan service with hardcoding all over 2024-05-24 17:23:27 +02:00
Daniel Barlow
0f520ceee2 create cdc-ncm module 2024-05-24 17:23:27 +02:00
Daniel Barlow
9cb73f3fec barebones usb_modeswitch package 2024-05-24 17:23:27 +02:00
Daniel Barlow
fc9cb8e07d l2tp set default route via tunnel 2024-05-24 17:23:27 +02:00
Daniel Barlow
1c9f20dd40 exec xl2tpd
haven't fully worked out why, but without this s6 is unable to stop it.
2024-05-24 17:23:27 +02:00
Daniel Barlow
4a6d93dc2c add rudimentary l2tp service module 2024-05-24 17:23:27 +02:00
Daniel Barlow
be1254f29c bordervm enable nat 2024-05-24 17:23:27 +02:00
Daniel Barlow
11384d78af gl-ar750 appendDTB 2024-05-24 17:23:27 +02:00
Daniel Barlow
b6e2585ebb memorable net device names for gl-ar750
linux's view of eth1 and eth0 are opposite to that of u-boot
2024-05-24 17:23:27 +02:00
Daniel Barlow
cd116ad9e7 list pkgs we need in bordervm build
it's a bit silly trying to build it with the whole liminix overlay
when it's a nixos system not a liminix system
2024-05-24 17:23:27 +02:00
Daniel Barlow
58cce5b544 run dhcp server on bordervm
this is for testing clients that have dhcp upstream
2024-05-24 17:23:27 +02:00