[cmds] Update 'sys' and 'mknod' to work for updating ELKS #2186
+12
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enhances the bin/sys shell script and mknod command to update an existing ELKS volume from the boot volume.
Discussed in #2181 (comment).
@floriangit: I created this PR as there might have been a misunderstanding about the need for set -e/set +e in bin/sys.
(set -e tells the shell to stop execution on an error). This PR fixes
sys
so that any error will stop the script, except for themakeboot
execution, which as you pointed out returns the filesystem type as it's return value. So a set +e is required only beforemakeboot
, and otherwise set -e is always set. Shouldmakeboot
encounter an error, it returns 255, and sys will return 1 (error) to its caller. Otherwise the script now will report "Finished successfully." to the user.mknod
was changed to return 0 on successful -p option, as discussed.Also fixed is "Can't create symlink: File Exists", which is reported by
cp -fR
when copying a full system and encountering the symlink already created on the destination volume. The fix is to unlink the symlink prior to creating it, when the -f option is in effect.