OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Toolchain
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version openwrt-18.06
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Michael Farrell - 21.08.2018
Last edited by Jo-Philipp Wich - 18.09.2018

FS#1803 - mcopy/mmd included with openwrt-imagebuilder-18.06.1 fail with error in _nl_intern_locale_data

Device problem occurs on

This issue impacts the OpenWRT imagebuilder, and impacts any device that requires mtools (because they use a FAT filesystem) as part of the image build process, eg: brcm2708/Raspberry Pi.

The following environments appear to use mtools:

  • arc770
  • archs38
  • at91
  • brcm2708
  • mvemu
  • mxs
  • omap
  • sunxi

Software versions of OpenWrt/LEDE release, packages, etc.

I used openwrt-imagebuilder-18.06.1-brcm2708-bcm2708.Linux-x86_64 (Raspberry Pi 1B).

Build environment is Fedora 28 (amd64).

Steps to reproduce

  1. make image (no modifications made to the environment)

Actual behaviour

mkfs.fat 4.1 (2017-01-24)
.mcopy.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
make[3]: *** [Makefile:87: /mnt/raid1/dev/openwrt-imagebuilder-18.06.1-brcm2708-bcm2708.Linux-x86_64/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/linux-brcm2708_bcm2708/tmp/openwrt-18.06.1-brcm2708-bcm2708-rpi-squashfs-factory.img.gz] Aborted (core dumped)
make[2]: *** [Makefile:165: build_image] Error 2
make[1]: *** [Makefile:116: _call_image] Error 2
make: *** [Makefile:193: image] Error 2

Then, after applying a workaround to mcopy:

.mmd.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
make[3]: *** [Makefile:87: /mnt/raid1/dev/openwrt-imagebuilder-18.06.1-brcm2708-bcm2708.Linux-x86_64/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/linux-brcm2708_bcm2708/tmp/openwrt-18.06.1-brcm2708-bcm2708-rpi-squashfs-factory.img.gz] Aborted (core dumped)
make[2]: *** [Makefile:165: build_image] Error 2
make[1]: *** [Makefile:116: _call_image] Error 2
make: *** [Makefile:193: image] Error 2

Workaround

  1. cd staging_dir/host/bin/
  2. mv mcopy mcopy.openwrt
  3. mv mmd mmd.openwrt
  4. ln -s /usr/bin/mcopy .
  5. ln -s /usr/bin/mmd .

After applying the work-around, the build process completes successfully, and all files appear correctly in the FAT partition.

Other notes

I attempted resetting the locale to C:

  1. export LC_ALL=C
  2. export LANG=C

This had no effect.

Closed by  Jo-Philipp Wich
18.09.2018 16:23
Reason for closing:  Fixed
Michael Farrell commented on 21.08.2018 12:03

I also tried just running the wrapper script, and get the same failure:

$ ./staging_dir/host/bin/mcopy --help
.mcopy.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)

Calling the binary directly seems to run. In that case it's using the system libraries rather than openwrt's:

$ ./staging_dir/host/bin/.mcopy.bin          
Unknown mtools command '.mcopy.bin'
Supported commands:
mattrib, mbadblocks, mcat, mcd, mclasserase, mcopy, mdel, mdeltree
mdir, mdoctorfat, mdu, mformat, minfo, mlabel, mmd, mmount
mpartition, mrd, mread, mmove, mren, mshowfat, mshortname, mtoolstest
mtype, mwrite, mzip
$ cp ./staging_dir/host/bin/.mcopy.bin  /tmp/mcopy
$ /tmp/mcopy  --help
Mtools version 4.0.18, dated January 9th, 2013
Usage: /tmp/mcopy [-spatnmQVBT] [-D clash_option] sourcefile targetfile
       /tmp/mcopy [-spatnmQVBT] [-D clash_option] sourcefile [sourcefiles...] targetdirectory
Admin
Jo-Philipp Wich commented on 21.08.2018 12:08

Please mention the distro you're testing on.

Is `LC_ALL=C ./staging_dir/host/bin/mcopy –help` working?

Baptiste Jonglez commented on 05.09.2018 10:56

This should be fixed in master by https://git.openwrt.org/9030a78a716b (and backported to 17.01.6 with https://git.openwrt.org/96e8f1c3878 )

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing