archive handler stuck with locale issues

297 views
Skip to first unread message

jspi...@gmail.com

unread,
Apr 20, 2018, 4:37:50 PM4/20/18
to swupdate
Trying to update with the following config snippet:

files: (
{
filename = "rootfs.tar.gz";
type = "archive";
path = "/mnt/rootfs";
preserve-attributes = true;
}
);


Get this error:

[ERROR] : SWUPDATE failed [0] ERROR handlers/archive_handler.c : extract : 110 : archive_read_next_header(): Linkname can't be converted from UTF-8 to current locale. 1

swupdate then freezes and does not exit or continue unpacking the archive.

james.h...@gmail.com

unread,
Dec 21, 2018, 11:31:41 PM12/21/18
to swupdate

Try passing --posix to tar when you are creating rootfs.tar.gz. This seems to be due to a libarchive bug https://github.com/libarchive/libarchive/issues/587.

James Hilliard

unread,
Dec 22, 2018, 4:17:00 PM12/22/18
to swupdate
Seems this bug is worse than I originally thought, the commit message
in https://github.com/mpv-player/mpv/commit/1e70e82baa9193f6f027338b0fab0f5078971fbe
gives a bit of an overview of the problem, I have no idea how to fix
this in swupdate though as libarchive seems to do insane things with
locale settings which are often non-standard for embedded systems(I've
yet to find a working locale configuration with buildroot).
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "swupdate" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/swupdate/zUOSqmkk7cA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to swupdate+u...@googlegroups.com.
> To post to this group, send email to swup...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

james.h...@gmail.com

unread,
Dec 23, 2018, 12:30:41 AM12/23/18
to swupdate
On Saturday, December 22, 2018 at 2:17:00 PM UTC-7, James Hilliard wrote:
> On Fri, Dec 21, 2018 at 9:31 PM <james.h...@gmail.com> wrote:
> >
> > On Friday, April 20, 2018 at 2:37:50 PM UTC-6, jspi...@gmail.com wrote:
> > > Trying to update with the following config snippet:
> > >
> > > files: (
> > > {
> > > filename = "rootfs.tar.gz";
> > > type = "archive";
> > > path = "/mnt/rootfs";
> > > preserve-attributes = true;
> > > }
> > > );
> > >
> > >
> > > Get this error:
> > >
> > > [ERROR] : SWUPDATE failed [0] ERROR handlers/archive_handler.c : extract : 110 : archive_read_next_header(): Linkname can't be converted from UTF-8 to current locale. 1
> > >
> > > swupdate then freezes and does not exit or continue unpacking the archive.
> >
> > Try passing --posix to tar when you are creating rootfs.tar.gz. This seems to be due to a libarchive bug https://github.com/libarchive/libarchive/issues/587.
> Seems this bug is worse than I originally thought, the commit message
> in https://github.com/mpv-player/mpv/commit/1e70e82baa9193f6f027338b0fab0f5078971fbe
> gives a bit of an overview of the problem, I have no idea how to fix
> this in swupdate though as libarchive seems to do insane things with
> locale settings which are often non-standard for embedded systems(I've
> yet to find a working locale configuration with buildroot).
I came up with a potential fix here https://github.com/sbabic/swupdate/compare/master...jameshilliard:locale which should work as long as one of the env variables LC_ALL, LC_CTYPE, LANG or the system locale is set to a valid UTF-8 locale, I did also send the patch to the mailing list(although it may have been caught in a spam filter since it didn't seem to show up yet).

Andy Gikling

unread,
May 26, 2022, 1:16:07 PM5/26/22
to swupdate
There's been more action on this recently.  See the end of https://github.com/libarchive/libarchive/issues/587

Several people have patched Swupdate's env for their systems.

It was a bug for me on Gatesgarth using swupdate and meta-swupdate.

~Andy Gikling
Reply all
Reply to author
Forward
0 new messages