Compare commits

...

3 Commits

Author SHA1 Message Date
Daniel Barlow 1dbdbbbb1a thinking 2022-09-27 22:58:56 +01:00
Daniel Barlow dfdaa27f39 make ppp log to stderr not syslog 2022-09-27 22:57:06 +01:00
Daniel Barlow 0632b5102e remove .service/.target/.bundle etc suffixes on service names
they don't seem to be providing value
2022-09-27 22:56:53 +01:00
4 changed files with 9 additions and 26 deletions

View File

@ -168,9 +168,6 @@ Tue Sep 27 16:14:18 BST 2022
TODO list is getting both longer and shorter, though longer on
average.
DONE 1) rename config.environment as .filesystem. and add module
types for it
2) perhaps we shouldn't use process-based services like [ou]dhcp as
queryable endpoint for interface addresses (e.g. when adding routes).
Instead have a separate service for interface address that depends on
@ -186,14 +183,8 @@ creates the interface instead of using an existing unconfigured one
5) write a test for udhcp
DONE 6) squashfs size is ~ 14MB for a configuration with not much in it,
look for obvious wastes of space
7) some of the pppoe config should be moved into a ppp service
8) some of configuration.nix (e.g. defining routes) should be moved into
tools
11) haven't done (overlayfs) overlays at all
13) upgrade ppp to something with an ipv6-up-script option, move ppp and pppoe derivations into their own files
@ -203,19 +194,16 @@ tools
15) "ip address add" seems to magically recognise v4 vs v6 but
is that specified or fluke?
DONE 18) maybe stop suffixing all the service names with .service
19) ship logs somehow to log collection system
19) syslogd - use busybox or s6? the only thing (so far) using it is pppd.
Maybe we could LD_PRELOAD it to use stderr instead
DONE 20) The option currently called defaultPackages needs a better name as
it doesn't have the same semantics as nixos
environment.defaultPackages. maybe call it packagesInProfile or
packagesOnPath. or defaultProfile.packages
21) dhcp, dns, hostap service for lan
22) support real hardware
Tue Sep 27 22:00:36 BST 2022
Found the cause of huge image size: rp-pppoe ships with scripts that
reference build-time packages, so we have x86-64 glibc in there
We don't need syslog just to accommodate ppp, there's an underdocumented
option for it to log to a file descriptor

View File

@ -17,7 +17,7 @@ interface: {
let
name = "${interface.device}.pppoe";
ip-up = writeAshScript "ip-up" {} ''
outputs=/run/service-state/${name}.service/
outputs=/run/service-state/${name}/
mkdir -p $outputs
(cd $outputs
echo $1 > ifname
@ -32,6 +32,7 @@ let
"ip-up-script" ip-up
"ipparam" name
"nodetach"
"logfd" "2"
];
in

View File

@ -14,7 +14,7 @@ action=$1
set_address() {
ip address replace $ip/$mask dev $interface
dir=/run/service-state/${name}.service/
dir=/run/service-state/${name}/
mkdir -p $dir
for i in lease mask ip router siaddr dns serverid subnet opt53 interface ; do
echo ''${!i} > $dir/$i

View File

@ -25,11 +25,6 @@ in rec {
"PPP_SYNC_TTY" = "y";
};
services.syslogd = longrun {
name = "syslogd";
run = "${pkgs.busybox}/bin/syslogd -n -O /run/syslog";
};
services.pppoe =
let iface = interface { type = "hardware"; device = "eth0"; };
in pppoe iface {
@ -64,7 +59,6 @@ in rec {
loopback
defaultroute4
packet_forwarding
syslogd
];
};