Musl memory#
Wed, 28 Feb 2018 00:36:07 +0000
A short post this week, but this is because I need to sleep, not because there is nothing to write about.
First up, NixWRT has moved. It is no longer part of a "lightly forked
nixpkgs" repo, it has its own repo containing only NixWRT stuff at
https://github.com/telent/nixwrt . Instead of embedding the Nix package collection it now requires that you provide it with one by e..g using the -I
flag to nix-build
nix-build -I nixpkgs=../nixpkgs-for-nixwrt/ -A tftproot backuphost.nix
Presently there is still a mildly forked Nix package collection involved, but it is now available separately, and I have started the process of feeding the changes back into upstream so I hope to be able to eliminate that dependency in time.
Second, it builds with musl - which is great news as the image for
`backuphost` is too big to fit in 8MB flash when using glibc. The
changes
required
to switch to musl are - apart from a small bug in nixpkgs libiconv
derivation - ludicrously trivial.
Third, I was not entirely correct last week when I said that upgrading to nixpkgs master caused nixwrt to break "almost not at all", because after I actually split the repos up I found a couple more patches needed than just the two mentioned. But nothing too serious.
Here's what it looks like:
[dan@loaclhost:~/src/nixwrt]$ ls -l yun/ total 9608 -r--r--r-- 1 root root 1565199 Jan 1 1970 kernel.image -r--r--r-- 1 root root 2568192 Jan 1 1970 rootfs.image -r-xr-xr-x 1 root root 5698784 Jan 1 1970 vmlinux
(vmlinux
is not actually required on the target, it's a leftover)
Next up will be more patch upstreaming, and making it generate an image I can actually flash onto a TL-WR842. It is claimed that the emergency debricking TFTP client only works when fed with actual TP-Link images and not with OpenWRT, which is going to be bit of a drag if true.