Skip to content

mv error if ISO built close to midnight #108

Description

@TimJCrowell

When building the live ISO via buildiso.sh, if the compilation phase begins before midnight and finishes after midnight, the final script execution fails during the file movement/cleanup stage. The script generates the ISO matching the initial execution date, but evaluates date a second time post-rollover when attempting to move the file, resulting in a mv: cannot stat ...: No such file or directory crash.

To reproduce:

  1. Start a build late in the evening, close to midnight (e.g., 11:59 PM).
  2. Allow the build to complete after midnight.
  3. Observe the mv error block right at the end of mkarchiso completion.

The issue has been narrowed down to line 191 of util-iso.sh in the most recent commit as of now (542a218):
mv "$outFolder/$_profile/cachyos-$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y.%m.%d)-x86_64.iso" "$outFolder/$_profile/${iso_file}"

Log:

[mkarchiso] INFO: Done!
[mkarchiso] INFO: Creating ISO image...
xorriso 1.5.8.pl02 : RockRidge filesystem manipulator, libburnia project.

xorriso : NOTE : Environment variable SOURCE_DATE_EPOCH encountered with value 1782535293
Drive current: -outdev 'stdio:/home/timothy/cachyos-archiso/out/desktop/cachyos-2026.06.26-x86_64.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 1319g free
Added to ISO image: directory '/'='/home/timothy/cachyos-archiso/build/iso'
xorriso : UPDATE :     105 files added in 1 seconds
xorriso : UPDATE :     105 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 432 bytes from file '/home/timothy/cachyos-archiso/build/iso/boot/syslinux/isohdpfx.bin'
libisofs: NOTE : Automatically adjusted MBR geometry to 1021/187/32
libisofs: NOTE : Aligned image size to cylinder size by 41 blocks
xorriso : UPDATE :  6.91% done
xorriso : UPDATE :  99.49% done
ISO image produced: 1539208 sectors
Written to medium : 1539208 sectors at LBA 0
Writing to 'stdio:/home/timothy/cachyos-archiso/out/desktop/cachyos-2026.06.26-x86_64.iso' completed successfully.

[mkarchiso] INFO: Done!
3.0G    /home/timothy/cachyos-archiso/out/desktop/cachyos-2026.06.26-x86_64.iso
mv: cannot stat '/home/timothy/cachyos-archiso/out/desktop/cachyos-2026.06.27-x86_64.iso': No such file or directory
==> ERROR: An unknown error has occurred. Exiting...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions