2018-06-18 03:50:17 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2018-06-19 04:49:35 +03:00
|
|
|
with import ../../modules/initrd-order.nix;
|
2018-06-18 03:50:17 +03:00
|
|
|
let
|
2018-06-19 05:23:15 +03:00
|
|
|
# This device description is a bit configurable through
|
|
|
|
# mobile options...
|
|
|
|
|
|
|
|
# Enabling the splash changes some settings.
|
|
|
|
splash = config.mobile.boot.stage-1.splash.enable;
|
|
|
|
|
2018-06-18 03:50:17 +03:00
|
|
|
kernel = pkgs.linuxPackages_4_16.kernel;
|
|
|
|
device_info = (lib.importJSON ../postmarketOS-devices.json).qemu-amd64;
|
|
|
|
|
2018-06-24 00:46:06 +03:00
|
|
|
modules = [
|
|
|
|
# Disk images
|
|
|
|
"ata_piix"
|
|
|
|
"sd_mod"
|
|
|
|
|
|
|
|
# Networking
|
|
|
|
"e1000"
|
2018-06-24 01:47:00 +03:00
|
|
|
|
|
|
|
# Keyboard
|
|
|
|
"hid_generic"
|
|
|
|
"pcips2" "atkbd" "i8042"
|
|
|
|
|
|
|
|
# x86 RTC needed by the stage 2 init script.
|
|
|
|
"rtc_cmos"
|
2018-06-24 00:46:06 +03:00
|
|
|
];
|
|
|
|
|
2018-06-18 03:50:17 +03:00
|
|
|
MODES = {
|
|
|
|
"800x600x16" = { vga = "788"; width = 800; height = 600; depth = 16; };
|
|
|
|
"1024x786x16" = { vga = "791"; width = 1024; height = 768; depth = 16; };
|
|
|
|
"1024x786x32" = { vga = "0x344"; width = 1024; height = 768; depth = 32; };
|
|
|
|
"1280x1024x16" = { vga = "794"; width = 1280; height = 1024; depth = 16; };
|
|
|
|
"1280x720x16" = { vga = "0x38d"; width = 1280; height = 720; depth = 16; };
|
|
|
|
"1280x720x24" = { vga = "0x38e"; width = 1280; height = 720; depth = 24; };
|
|
|
|
"1280x720x32" = { vga = "0x38f"; width = 1280; height = 720; depth = 32; };
|
|
|
|
"1920x1080x16" = { vga = "0x390"; width = 1920; height = 1080; depth = 16; };
|
|
|
|
"1920x1080x24" = { vga = "0x391"; width = 1920; height = 1080; depth = 24; };
|
|
|
|
"1920x1080x32" = { vga = "0x392"; width = 1920; height = 1080; depth = 32; };
|
|
|
|
};
|
|
|
|
|
2018-06-19 04:50:10 +03:00
|
|
|
MODE = MODES."1280x720x32";
|
2018-06-18 03:50:17 +03:00
|
|
|
in
|
|
|
|
{
|
|
|
|
mobile.device.name = "qemu-x86_64";
|
|
|
|
mobile.device.info = device_info // {
|
|
|
|
# TODO : make kernel part of options.
|
|
|
|
inherit kernel;
|
2018-06-19 04:53:34 +03:00
|
|
|
kernel_cmdline = device_info.kernel_cmdline
|
|
|
|
+ " vga=${MODE.vga}"
|
|
|
|
# TODO : make cmdline configurable outside device.info (device.info would be used for device-specifics only)
|
|
|
|
+ lib.optionalString splash " quiet vt.global_cursor_default=0"
|
|
|
|
;
|
2018-06-18 03:50:17 +03:00
|
|
|
};
|
|
|
|
mobile.hardware = {
|
|
|
|
soc = "generic-x86_64";
|
|
|
|
screen = {
|
|
|
|
inherit (MODE) height width;
|
|
|
|
};
|
|
|
|
ram = 512;
|
|
|
|
};
|
2018-06-27 04:52:09 +03:00
|
|
|
|
2018-06-18 03:50:17 +03:00
|
|
|
mobile.system.type = "kernel-initrd";
|
|
|
|
mobile.boot.stage-1 = {
|
2018-06-19 04:53:34 +03:00
|
|
|
redirect-log.targets = lib.mkIf (splash != true) [ "/dev/tty0" ];
|
2018-06-19 04:49:35 +03:00
|
|
|
init = (lib.mkOrder BEFORE_READY_INIT ''
|
|
|
|
echo "cmdline:"
|
|
|
|
cat /proc/cmdline
|
|
|
|
echo "Hi there from /init!"
|
|
|
|
'');
|
2018-06-24 00:46:06 +03:00
|
|
|
kernel = {
|
|
|
|
modular = true;
|
|
|
|
inherit modules;
|
|
|
|
};
|
2018-06-18 03:50:17 +03:00
|
|
|
};
|
|
|
|
}
|