nixfmt-rfc-style
There is nothing in this commit except for the changes made by nix-shell -p nixfmt-rfc-style --run "nixfmt ." If this has mucked up your open branches then sorry about that. You can probably nixfmt them to match before merging
This commit is contained in:
@@ -1,18 +1,31 @@
|
||||
{ config, pkgs, lib, lim, ... } :
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
lim,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (pkgs.pseudofile) dir;
|
||||
dts = pkgs.runCommand "qemu.dts" {
|
||||
nativeBuildInputs = with pkgs.pkgsBuildBuild; [ dtc qemu ];
|
||||
} ''
|
||||
qemu-system-${pkgs.stdenv.hostPlatform.qemuArch} \
|
||||
-machine virt -machine dumpdtb=tmp.dtb
|
||||
dtc -I dtb -O dts -o $out tmp.dtb
|
||||
# https://stackoverflow.com/a/69890137,
|
||||
# XXX try fdtput $out -p -t s /pl061@9030000 status disabled
|
||||
# instead of using sed
|
||||
sed -i $out -e 's/compatible = "arm,pl061.*/status = "disabled";/g'
|
||||
'';
|
||||
in {
|
||||
dts =
|
||||
pkgs.runCommand "qemu.dts"
|
||||
{
|
||||
nativeBuildInputs = with pkgs.pkgsBuildBuild; [
|
||||
dtc
|
||||
qemu
|
||||
];
|
||||
}
|
||||
''
|
||||
qemu-system-${pkgs.stdenv.hostPlatform.qemuArch} \
|
||||
-machine virt -machine dumpdtb=tmp.dtb
|
||||
dtc -I dtb -O dts -o $out tmp.dtb
|
||||
# https://stackoverflow.com/a/69890137,
|
||||
# XXX try fdtput $out -p -t s /pl061@9030000 status disabled
|
||||
# instead of using sed
|
||||
sed -i $out -e 's/compatible = "arm,pl061.*/status = "disabled";/g'
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../modules/outputs/ext4fs.nix
|
||||
../../modules/outputs/tftpboot.nix
|
||||
@@ -25,12 +38,14 @@ in {
|
||||
hardware.dts.src = lib.mkOverride 500 dts;
|
||||
boot.tftp = {
|
||||
loadAddress =
|
||||
let offsets = {
|
||||
mips = "0x88000000";
|
||||
arm = "0x44000000";
|
||||
aarch64 = "0x44000000";
|
||||
};
|
||||
in lim.parseInt offsets.${pkgs.stdenv.hostPlatform.qemuArch} ;
|
||||
let
|
||||
offsets = {
|
||||
mips = "0x88000000";
|
||||
arm = "0x44000000";
|
||||
aarch64 = "0x44000000";
|
||||
};
|
||||
in
|
||||
lim.parseInt offsets.${pkgs.stdenv.hostPlatform.qemuArch};
|
||||
serverip = "10.0.2.2";
|
||||
ipaddr = "10.0.2.15";
|
||||
};
|
||||
|
@@ -1,44 +1,55 @@
|
||||
let check = deviceName : config :
|
||||
let derivation = (import <liminix> {
|
||||
device = import (<liminix/devices> + "/${deviceName}");
|
||||
liminix-config = { ... } : {
|
||||
imports = [./configuration.nix];
|
||||
inherit config;
|
||||
};
|
||||
});
|
||||
img = derivation.outputs.tftpboot;
|
||||
uboot = derivation.outputs.u-boot;
|
||||
pkgsBuild = derivation.pkgs.pkgsBuildBuild;
|
||||
in pkgsBuild.runCommand "check-${deviceName}" {
|
||||
nativeBuildInputs = with pkgsBuild; [
|
||||
expect
|
||||
socat
|
||||
run-liminix-vm
|
||||
] ;
|
||||
} ''
|
||||
mkdir vm
|
||||
ln -s ${img} result
|
||||
let
|
||||
check =
|
||||
deviceName: config:
|
||||
let
|
||||
derivation = (
|
||||
import <liminix> {
|
||||
device = import (<liminix/devices> + "/${deviceName}");
|
||||
liminix-config =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./configuration.nix ];
|
||||
inherit config;
|
||||
};
|
||||
}
|
||||
);
|
||||
img = derivation.outputs.tftpboot;
|
||||
uboot = derivation.outputs.u-boot;
|
||||
pkgsBuild = derivation.pkgs.pkgsBuildBuild;
|
||||
in
|
||||
pkgsBuild.runCommand "check-${deviceName}"
|
||||
{
|
||||
nativeBuildInputs = with pkgsBuild; [
|
||||
expect
|
||||
socat
|
||||
run-liminix-vm
|
||||
];
|
||||
}
|
||||
''
|
||||
mkdir vm
|
||||
ln -s ${img} result
|
||||
|
||||
touch empty empty2
|
||||
touch empty empty2
|
||||
|
||||
run-liminix-vm \
|
||||
--background ./vm \
|
||||
--u-boot ${uboot}/u-boot.bin \
|
||||
--arch ${derivation.pkgs.stdenv.hostPlatform.qemuArch} \
|
||||
--wan "user,tftp=`pwd`" \
|
||||
--disk-image empty2 \
|
||||
empty empty2
|
||||
run-liminix-vm \
|
||||
--background ./vm \
|
||||
--u-boot ${uboot}/u-boot.bin \
|
||||
--arch ${derivation.pkgs.stdenv.hostPlatform.qemuArch} \
|
||||
--wan "user,tftp=`pwd`" \
|
||||
--disk-image empty2 \
|
||||
empty empty2
|
||||
|
||||
expect ${./script.expect} 2>&1 |tee $out
|
||||
'';
|
||||
in {
|
||||
aarch64 = check "qemu-aarch64" {};
|
||||
arm = check "qemu-armv7l" {};
|
||||
armZimage = check "qemu-armv7l" {
|
||||
expect ${./script.expect} 2>&1 |tee $out
|
||||
'';
|
||||
in
|
||||
{
|
||||
aarch64 = check "qemu-aarch64" { };
|
||||
arm = check "qemu-armv7l" { };
|
||||
armZimage = check "qemu-armv7l" {
|
||||
boot.tftp.kernelFormat = "zimage";
|
||||
};
|
||||
mips = check "qemu" {};
|
||||
mipsLz = check "qemu" {
|
||||
mips = check "qemu" { };
|
||||
mipsLz = check "qemu" {
|
||||
boot.tftp.compressRoot = true;
|
||||
};
|
||||
# this works on real hardware but I haven't figured out how
|
||||
|
Reference in New Issue
Block a user