1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-09-19 07:47:20 +03:00

system-types: Rename kernel-initrd -> qemu-startscript

In addition, put the implementation of the build side-by-side with the
system type definition. It made no sense to keep those where they were,
as it was baggage from the earlier implementation of the project.
This commit is contained in:
Samuel Dionne-Riel 2020-05-15 15:58:58 -04:00
parent b1870eb331
commit dcbda16fc5
4 changed files with 12 additions and 12 deletions

View File

@ -64,7 +64,7 @@ in
ram = 1024 * 2;
};
mobile.system.type = "kernel-initrd";
mobile.system.type = "qemu-startscript";
mobile.boot.stage-1 = {
kernel = {
modular = true;

View File

@ -12,7 +12,7 @@ in
{
imports = [
./system-types/depthcharge
./system-types/kernel-initrd
./system-types/qemu-startscript
./system-types/android
./system-types/u-boot
];

View File

@ -5,17 +5,17 @@ let
device_name = device_config.name;
hardware_config = config.mobile.hardware;
rootfs = config.system.build.rootfs;
enabled = config.mobile.system.type == "kernel-initrd";
enabled = config.mobile.system.type == "qemu-startscript";
kernel-initrd = pkgs.callPackage ../../../systems/kernel-initrd.nix {
qemu-startscript = pkgs.callPackage ./qemu-startscript-build.nix {
inherit device_config hardware_config;
initrd = config.system.build.initrd;
};
system = pkgs.linkFarm "${device_config.name}-build" [
{
name = "kernel-initrd";
path = "kernel-initrd";
name = "qemu-startscript";
path = "qemu-startscript";
}
{
name = "system";
@ -28,7 +28,7 @@ let
in
{
config = lib.mkMerge [
{ mobile.system.types = [ "kernel-initrd" ]; }
{ mobile.system.types = [ "qemu-startscript" ]; }
(lib.mkIf enabled {
system.build = rec {
@ -45,10 +45,10 @@ in
qemu-system-x86_64 \
-enable-kvm \
-kernel "${kernel-initrd}/kernel" \
-initrd "${kernel-initrd}/initrd" \
-append "$(cat "${kernel-initrd}/cmdline.txt")" \
-m "$(cat "${kernel-initrd}/ram.txt")M" \
-kernel "${qemu-startscript}/kernel" \
-initrd "${qemu-startscript}/initrd" \
-append "$(cat "${qemu-startscript}/cmdline.txt")" \
-m "$(cat "${qemu-startscript}/ram.txt")M" \
-serial "mon:stdio" \
-drive "file=fs.img,format=raw" \
-device VGA,edid=on,xres=${xres},yres=${yres} \

View File

@ -16,7 +16,7 @@ let
cmdline = device_info.kernel_cmdline;
in
stdenv.mkDerivation {
name = "mobile-nixos_${device_name}-kernel-initrd";
name = "mobile-nixos_${device_name}-qemu-startscript";
src = builtins.filterSource (path: type: false) ./.;
unpackPhase = "true";