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
|
|
|
|
2023-02-10 18:54:33 +01:00
|
|
|
module = {pkgs, ... }: {
|
|
|
|
kernel = {
|
|
|
|
src = pkgs.pkgsBuildBuild.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
|
|
|
};
|
2023-02-10 18:54:33 +01:00
|
|
|
config = {
|
|
|
|
MIPS_MALTA= "y";
|
|
|
|
CPU_LITTLE_ENDIAN= "n";
|
|
|
|
CPU_BIG_ENDIAN= "y";
|
|
|
|
CPU_MIPS32_R2= "y";
|
2022-09-21 00:04:08 +02:00
|
|
|
|
2023-02-10 18:54:33 +01:00
|
|
|
SQUASHFS = "y";
|
|
|
|
SQUASHFS_XZ = "y";
|
2022-10-18 23:28:07 +02:00
|
|
|
|
2023-02-10 18:54:33 +01:00
|
|
|
VIRTIO_MENU = "y";
|
|
|
|
PCI = "y";
|
|
|
|
VIRTIO_PCI = "y";
|
|
|
|
BLOCK = "y";
|
|
|
|
VIRTIO_BLK = "y";
|
|
|
|
NETDEVICES = "y";
|
|
|
|
VIRTIO_NET = "y";
|
2022-10-18 23:28:07 +02:00
|
|
|
|
2023-02-10 18:54:33 +01:00
|
|
|
SERIAL_8250= "y";
|
|
|
|
SERIAL_8250_CONSOLE= "y";
|
|
|
|
};
|
2022-09-20 19:54:27 +02:00
|
|
|
};
|
2023-02-11 14:10:38 +01:00
|
|
|
device.defaultOutput = "vmroot";
|
2022-09-20 19:54:27 +02:00
|
|
|
};
|
2022-09-20 17:09:44 +02:00
|
|
|
}
|