2019-08-31 05:43:30 +03:00
|
|
|
{ imageBuilder, libfaketime, e2fsprogs, make_ext4fs }:
|
2019-08-30 01:16:39 +03:00
|
|
|
|
|
|
|
/* */ let scope = { "fileSystem.makeExt4" =
|
|
|
|
|
2019-08-31 05:43:30 +03:00
|
|
|
let
|
|
|
|
inherit (imageBuilder) makeFilesystem;
|
|
|
|
in
|
2019-08-30 01:16:39 +03:00
|
|
|
{ partitionID, ... } @ args:
|
|
|
|
makeFilesystem (args // {
|
|
|
|
filesystemType = "ext4";
|
|
|
|
|
2019-08-31 05:43:30 +03:00
|
|
|
minimumSize = imageBuilder.size.MiB 5;
|
2019-08-30 01:16:39 +03:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
e2fsprogs
|
|
|
|
make_ext4fs
|
|
|
|
libfaketime
|
|
|
|
];
|
|
|
|
|
|
|
|
filesystemPhase = ''
|
|
|
|
:
|
|
|
|
'';
|
|
|
|
|
|
|
|
copyPhase = ''
|
|
|
|
faketime "1970-01-01 00:00:00" \
|
|
|
|
make_ext4fs \
|
|
|
|
-L $partName \
|
|
|
|
-l $size \
|
|
|
|
-U $partitionID \
|
|
|
|
"$img" \
|
|
|
|
.
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
EXT2FS_NO_MTAB_OK=yes fsck.ext4 -n -f $img
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
|
|
|
|
/* */ ;}; in scope."fileSystem.makeExt4"
|