2022-10-03 23:28:15 +02:00
|
|
|
# This "device" generates images that can be used with the QEMU
|
|
|
|
# emulator. The default output is a directory containing separate
|
|
|
|
# kernel (uncompressed vmlinux) and initrd (squashfs) images
|
|
|
|
|
2022-09-20 17:09:44 +02:00
|
|
|
{
|
|
|
|
system = {
|
|
|
|
crossSystem = {
|
|
|
|
config = "mips-unknown-linux-musl";
|
|
|
|
gcc = {
|
|
|
|
abi = "32";
|
|
|
|
arch = "mips32"; # maybe mips_24kc-
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-10-15 19:55:33 +02:00
|
|
|
|
|
|
|
overlay = final: prev:
|
2022-10-18 23:28:07 +02:00
|
|
|
let inherit (final) stdenvNoCC fetchFromGitHub;
|
2022-10-15 19:55:33 +02:00
|
|
|
in {
|
2022-10-19 18:34:22 +02:00
|
|
|
kernel = prev.kernel.override {
|
|
|
|
# using fetchurl not fetchzip because it doesn't unpack, and
|
|
|
|
# copying 6GB of data from one store location to another
|
|
|
|
# takes an absolute bloody age
|
|
|
|
src = final.fetchurl {
|
|
|
|
name = "linux.tar.gz";
|
|
|
|
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.19.16.tar.gz";
|
|
|
|
hash = "sha256-m4NeoEsCEK0HSIKTZ6zYTgk1fD3W0PSOMXN6fyHpkP8=";
|
|
|
|
};
|
2022-10-15 19:55:33 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-09-20 19:54:27 +02:00
|
|
|
kernel = {
|
2022-10-18 23:28:07 +02:00
|
|
|
checkedConfig = {
|
2022-09-20 19:54:27 +02:00
|
|
|
MIPS_MALTA= "y";
|
|
|
|
CPU_LITTLE_ENDIAN= "n";
|
2022-10-05 22:57:38 +02:00
|
|
|
CPU_BIG_ENDIAN= "y";
|
2022-09-20 19:54:27 +02:00
|
|
|
CPU_MIPS32_R2= "y";
|
2022-09-21 00:04:08 +02:00
|
|
|
|
|
|
|
SQUASHFS = "y";
|
|
|
|
SQUASHFS_XZ = "y";
|
2022-10-18 23:28:07 +02:00
|
|
|
|
|
|
|
VIRTIO_MENU = "y";
|
|
|
|
PCI = "y";
|
2022-09-21 00:04:08 +02:00
|
|
|
VIRTIO_PCI = "y";
|
2022-10-18 23:28:07 +02:00
|
|
|
BLOCK = "y";
|
2022-09-21 00:04:08 +02:00
|
|
|
VIRTIO_BLK = "y";
|
2022-10-18 23:28:07 +02:00
|
|
|
NETDEVICES = "y";
|
2022-09-21 00:04:08 +02:00
|
|
|
VIRTIO_NET = "y";
|
2022-10-18 23:28:07 +02:00
|
|
|
|
|
|
|
SERIAL_8250= "y";
|
|
|
|
SERIAL_8250_CONSOLE= "y";
|
2022-09-20 19:54:27 +02:00
|
|
|
};
|
|
|
|
};
|
2022-10-03 23:28:15 +02:00
|
|
|
outputs.default = "directory";
|
2022-09-20 17:09:44 +02:00
|
|
|
}
|