Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
openwrt-bot opened this issue Aug 21, 2018 · 3 comments
Labels

Comments

@openwrt-bot
Copy link

openwrt-bot commented Aug 21, 2018

micolous:

======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======

  • 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======

  • cd staging_dir/host/bin/
  • mv mcopy mcopy.openwrt
  • mv mmd mmd.openwrt
  • ln -s /usr/bin/mcopy .
  • 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:

  • export LC_ALL=C
  • export LANG=C

This had no effect.

@openwrt-bot
Copy link
Author

openwrt-bot commented Aug 21, 2018

micolous:

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

@openwrt-bot
Copy link
Author

openwrt-bot commented Aug 21, 2018

jow-:

Please mention the distro you're testing on.

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

@openwrt-bot
Copy link
Author

openwrt-bot commented Sep 5, 2018

bjonglez:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant