ocs-iso: Always return success after successful iso creation
The ocs-iso script returns exit code of the last command executed. This is either failure of [ -e "$target_iso" ], or failure from [ "$BOOTUP" = "color" ], or result of $SETCOLOR_NORMAL execution.
In the case if BOOTUP is different from "color" ocs-iso returns non-zero (a failure) even after successful generation of iso image, which can confuse a caller script.
Signed-off-by: Vitaly Kuzmichev vkuzmichev@dev.rtsoft.ru
Merge request reports
Activity
mentioned in commit db2fd269
I think it would be still useful to get failure exit code if iso file is not created. However, I see sometimes xorriso fails with empty file created (not a bug of your software), so a caller of ocs-iso should perform iso validity checks anyway. Should this be documented somewhere (man-page or usage help message)?
Anyway thanks for your attention.
I'm finally ok with just
exit 0
as it lets my script-caller which usesset -e
to remove workaround for "unpredicatable" exit code (though it's not much code so far).Sure.
The exit code from xorriso will be assigned to rc in line 1023, according to https://gitlab.com/stevenshiau/clonezilla/-/blob/master/sbin/ocs-iso
Hence if it's greater than 0, then ocs-iso will exit with return code 1. So normally in the end it returns with 0.