add ext4 as rootfsType

This commit is contained in:
Daniel Barlow 2023-11-06 21:52:31 +00:00
parent 6bbff2f5b3
commit a9d847e2c0
6 changed files with 102 additions and 2 deletions

View file

@ -3,7 +3,8 @@
pseudofiles = import ./pseudofiles/test.nix;
wlan = import ./wlan/test.nix;
pppoe = import ./pppoe/test.nix;
jffs2 = import ./jffs2/test.nix;
jffs2 = import ./jffs2/test.nix;
ext4 = import ./ext4/test.nix;
min-copy-closure = import ./min-copy-closure/test.nix;
fennel = import ./fennel/test.nix;
}

View file

@ -0,0 +1,19 @@
{ config, pkgs, lib, ... } :
let
inherit (pkgs.pseudofile) dir symlink;
in {
imports = [
../../vanilla-configuration.nix
../../modules/squashfs.nix
../../modules/ext4fs.nix
];
config.rootfsType = "ext4";
config.filesystem = dir {
hello = {
type = "f";
uid = 7;
gid = 24;
file = "hello world";
};
};
}

11
tests/ext4/script.expect Normal file
View file

@ -0,0 +1,11 @@
set timeout 10
spawn socat unix-connect:vm/console -
send "\r\n"
expect "login:" { send "root\r\n" }
expect "#"
send "echo HELLO WORLD > /hello\r\n"
expect "#"
send "cat /hello\r\n"
expect 'HELLO WORLD'
close

19
tests/ext4/test.nix Normal file
View file

@ -0,0 +1,19 @@
{
liminix
, nixpkgs
}:
let img = (import liminix {
device = import "${liminix}/devices/qemu/";
liminix-config = ./configuration.nix;
}).outputs.vmroot;
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
in pkgs.runCommand "check" {
nativeBuildInputs = with pkgs; [
expect
socat
] ;
} ''
mkdir vm
${img}/run.sh --background ./vm
expect ${./script.expect} >$out
''