Skip to content

Commit

Permalink
base-files: sysupgrade: do not hide tar errors
Browse files Browse the repository at this point in the history
tar stderr was probably discarded only to remove this message:

  tar: removing leading '/' from member names

However, together with that, any other error would also be discarded.
It is easier to fix that allowing the error message to be printed.

In sysupgrade, the backup file list only uses absolute paths. That way,
the solution is to remove the leading '/' from all files (sed) and chdir
to / (option -C /)

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
  • Loading branch information
luizluca authored and Rafał Miłecki committed Feb 19, 2024
1 parent 0ef9274 commit 14ac91c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package/base-files/files/sbin/sysupgrade
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ do_save_conffiles() {

v "Saving config files..."
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
tar c${TAR_V}zf "$conf_tar" -T "$CONFFILES" 2>/dev/null
sed -i -e 's,^/,,' "$CONFFILES"
tar c${TAR_V}zf "$conf_tar" -C / -T "$CONFFILES"
if [ "$?" -ne 0 ]; then
echo "Failed to create the configuration backup."
rm -f "$conf_tar"
Expand Down

2 comments on commit 14ac91c

@schuettecarsten
Copy link

@schuettecarsten schuettecarsten commented on 14ac91c Feb 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if the issue is caused by this commit, but it's not possible to create a config backup using sysupgrade -b <filename> at bcm27xx at the moment:

Tue Feb 20 13:39:39 CET 2024 upgrade: Saving config files...
tar: boot/cmdline.txt: No such file or directory
tar: boot/config.txt: No such file or directory
tar: error exit delayed from previous errors
Failed to create the configuration backup.

@luizluca
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if the issue is caused by this commit, but it's not possible to create a config backup using sysupgrade -b <filename> at bcm27xx at the moment:

Tue Feb 20 13:39:39 CET 2024 upgrade: Saving config files...
tar: boot/cmdline.txt: No such file or directory
tar: boot/config.txt: No such file or directory
tar: error exit delayed from previous errors
Failed to create the configuration backup.

No, this commit is actually helping by showing you the errors. The problem is probably with the 4fa9aaf.

Please sign in to comment.