This changes the practice for building kernel modules: now we expect
that the appropriate Kconfig symbols are set to =m in
config.kernel.config, and then use pkgs.kmodloader to create
a service that loads and unloads all the modules depended on by
a particular requirement.
Note that modules won't be installed on the target device just by
virue of having been built: only the modules that are referenced by a
kmodloader package will be in the closure.
An example may make this clearer: see modules/firewall/default.nix
in this commit.
Why?
If you have a compiled Linux kernel source tree and you change some
symbol from "is not set" to m and then run make modules, you cannot in
general expect that newly compiled module to work. This is because
there are places in the build of the main kernel where it looks to see
which modules _may_ be defined and uses that information to
accommodate them.
For example in an in-kernel build of
https://github.com/torvalds/linux/blob/master/net/netfilter/core.c#L689
some symbols are defined only if CONFIG_NF_CONNTRACK is set, meaning
this code won't work if we have it unset initially then try later to
enable it and build modules only. Or see
https://github.com/torvalds/linux/blob/master/include/linux/netdevice.h#L160
which copies the init stuff (whatever it is) from store to /persist
instead of making liminix-rebuild have to know what the files are.
This is principally to ease making a system configuration in /mnt or
similar when operating in a rescue/recovery scenario, and we
don't want to liminix-rebuild because it will reboot
This is for MIPS. I spent a while investigating why the second virtio
net device doesn't function in qemu mips malta u-boot, but with no
success. Use the first one instead.
1) "Unknown transfer id" message was because the local variable "tid"
is not a transfer id, it is a sequence number - so the check was
actually comparing expected vs actual acknowledged sequence number,
not TID. It's still a problem if we get the wrong one, but it
indicates a lost packet (so we should resend) not a packet that was
sent from somewhere else.
2) if the ACK packet has not been received, our retry should involve
_resending_ it, not just trying to wait for it again.
3) I have removed the timeout condition for terminating the resend
loop, because in practice (assuming both ends have the same timeout
setting) all it did was ensure that the loop only ran once. The
timeout is supposed to regulate how long we wait for before retrying
(it doesn't do this, we wait indefinitely), not how long we wait for
before giving up.
- patch dtb to add reserved-memory stanza for the phram device to use
(aarch64 does not accept memmap= command line option)
- patch phram driver to use memremap() instead of ioremap() as
ioremap can't be used for system ram on arm devices
I may have broken the run-liminix-vm command a bit for MIPS due to
necessary changes in how we pass the command line. If CI isn't green
for this commit and youre trying the worked examples, I suggest
reverting to the commit before this one.
The second parameter is now an options attrset, wherein we will pile
all kinds of cool stuff.
Right now the only cool bit is `mainFunction`, which allows you to
compile a fennel module into a lua script and name the function that
should be executed when the script runs. This makes it easier to
write testable Fennel code, because the test script can require the
module and call stuff in it.
this means fennelrepl in nix-shell will prefer local
source files to generated lua files, making it easier
to change library code without restarting the shell
This requires adding LFS as a dependency because native Lua has
no way to iterate a directory, but it seems to be Not Huge and
hopefully we'll have other uses for it