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

This commit is contained in:
nikstur
2025-09-29 12:58:44 +00:00
committed by GitHub
3 changed files with 7 additions and 7 deletions

View File

@@ -30,7 +30,7 @@
# arguments # arguments
name, name,
version, version,
imageFileBasename, baseName,
compression, compression,
fileSystems, fileSystems,
finalPartitions, finalPartitions,
@@ -205,7 +205,7 @@ stdenvNoCC.mkDerivation (
echo "Building image with systemd-repart..." echo "Building image with systemd-repart..."
unshare --map-root-user fakeroot systemd-repart \ unshare --map-root-user fakeroot systemd-repart \
''${systemdRepartFlags[@]} \ ''${systemdRepartFlags[@]} \
${imageFileBasename}.raw \ ${baseName}.raw \
| tee repart-output.json | tee repart-output.json
runHook postBuild runHook postBuild
@@ -220,14 +220,14 @@ stdenvNoCC.mkDerivation (
# separate derivation to allow users to save disk space. Disk images are # 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. # already very space intensive so we want to allow users to mitigate this.
+ lib.optionalString compression.enable '' + lib.optionalString compression.enable ''
for f in ${imageFileBasename}*; do for f in ${baseName}*; do
echo "Compressing $f with ${compression.algorithm}..." echo "Compressing $f with ${compression.algorithm}..."
# Keep the original file when compressing and only delete it afterwards # Keep the original file when compressing and only delete it afterwards
${compressionCommand} $f && rm $f ${compressionCommand} $f && rm $f
done done
'' ''
+ '' + ''
mv -v repart-output.json ${imageFileBasename}* $out mv -v repart-output.json ${baseName}* $out
runHook postInstall runHook postInstall
''; '';

View File

@@ -194,8 +194,8 @@ in
| assert_uki_repart_match.py "${config.system.build.intermediateImage}/repart-output.json" | assert_uki_repart_match.py "${config.system.build.intermediateImage}/repart-output.json"
# copy the uncompressed intermediate image, so that systemd-repart picks it up # copy the uncompressed intermediate image, so that systemd-repart picks it up
cp -v ${config.system.build.intermediateImage}/${config.image.repart.imageFileBasename}.raw . cp -v ${config.system.build.intermediateImage}/${config.image.baseName}.raw .
chmod +w ${config.image.repart.imageFileBasename}.raw chmod +w ${config.image.baseName}.raw
''; '';
# replace "TBD" with the original roothash values # replace "TBD" with the original roothash values

View File

@@ -408,7 +408,7 @@ in
mkfsEnv = mkfsOptionsToEnv cfg.mkfsOptions; mkfsEnv = mkfsOptionsToEnv cfg.mkfsOptions;
val = pkgs.callPackage ./repart-image.nix { val = pkgs.callPackage ./repart-image.nix {
systemd = cfg.package; systemd = cfg.package;
imageFileBasename = config.image.baseName; inherit (config.image) baseName;
inherit (cfg) inherit (cfg)
name name
version version