modules/image/repart: repart.imageFile(Basename) -> image.baseName (#437117)

nikstur 3ba94658 947e2d60

Changed files
+7 -7
nixos
+4 -4
nixos/modules/image/repart-image.nix
···
# arguments
name,
version,
-
imageFileBasename,
compression,
fileSystems,
finalPartitions,
···
echo "Building image with systemd-repart..."
unshare --map-root-user fakeroot systemd-repart \
''${systemdRepartFlags[@]} \
-
${imageFileBasename}.raw \
| tee repart-output.json
runHook postBuild
···
# separate derivation to allow users to save disk space. Disk images are
# already very space intensive so we want to allow users to mitigate this.
+ lib.optionalString compression.enable ''
-
for f in ${imageFileBasename}*; do
echo "Compressing $f with ${compression.algorithm}..."
# Keep the original file when compressing and only delete it afterwards
${compressionCommand} $f && rm $f
done
''
+ ''
-
mv -v repart-output.json ${imageFileBasename}* $out
runHook postInstall
'';
···
# arguments
name,
version,
+
baseName,
compression,
fileSystems,
finalPartitions,
···
echo "Building image with systemd-repart..."
unshare --map-root-user fakeroot systemd-repart \
''${systemdRepartFlags[@]} \
+
${baseName}.raw \
| tee repart-output.json
runHook postBuild
···
# separate derivation to allow users to save disk space. Disk images are
# already very space intensive so we want to allow users to mitigate this.
+ lib.optionalString compression.enable ''
+
for f in ${baseName}*; do
echo "Compressing $f with ${compression.algorithm}..."
# Keep the original file when compressing and only delete it afterwards
${compressionCommand} $f && rm $f
done
''
+ ''
+
mv -v repart-output.json ${baseName}* $out
runHook postInstall
'';
+2 -2
nixos/modules/image/repart-verity-store.nix
···
| assert_uki_repart_match.py "${config.system.build.intermediateImage}/repart-output.json"
# copy the uncompressed intermediate image, so that systemd-repart picks it up
-
cp -v ${config.system.build.intermediateImage}/${config.image.repart.imageFileBasename}.raw .
-
chmod +w ${config.image.repart.imageFileBasename}.raw
'';
# replace "TBD" with the original roothash values
···
| assert_uki_repart_match.py "${config.system.build.intermediateImage}/repart-output.json"
# copy the uncompressed intermediate image, so that systemd-repart picks it up
+
cp -v ${config.system.build.intermediateImage}/${config.image.baseName}.raw .
+
chmod +w ${config.image.baseName}.raw
'';
# replace "TBD" with the original roothash values
+1 -1
nixos/modules/image/repart.nix
···
mkfsEnv = mkfsOptionsToEnv cfg.mkfsOptions;
val = pkgs.callPackage ./repart-image.nix {
systemd = cfg.package;
-
imageFileBasename = config.image.baseName;
inherit (cfg)
name
version
···
mkfsEnv = mkfsOptionsToEnv cfg.mkfsOptions;
val = pkgs.callPackage ./repart-image.nix {
systemd = cfg.package;
+
inherit (config.image) baseName;
inherit (cfg)
name
version