Fix glibc locales

Fixes https://gitlab.com/kupfer/kupferbootstrap/-/issues/11
This commit is contained in:
jld3103 2021-08-13 20:25:33 +02:00
parent 6ec0c3cf39
commit 35ec53b615
2 changed files with 22 additions and 4 deletions

View file

@ -338,6 +338,28 @@ def build_package(package: Package):
if package.mode == 'cross':
logging.info(f'Cross-compiling {package.path}')
def umount():
subprocess.run(
[
'umount',
'-lc',
'/usr/share/i18n/locales',
],
stderr=subprocess.DEVNULL,
)
result = subprocess.run([
'mount',
'-o',
'bind',
'/chroot/copy/usr/share/i18n/locales',
'/usr/share/i18n/locales',
])
if result.returncode != 0:
logging.fatal(f'Failed to bind mount glibc locales from chroot')
exit(1)
result = subprocess.run(
makepkg_cmd + makepkg_compile_opts,
env=makepkg_cross_env | {'QEMU_LD_PREFIX': '/usr/aarch64-linux-gnu'},

View file

@ -58,8 +58,6 @@ else:
atexit.register(at_exit)
# TODO: Remove the mount of /usr/share/i18n/locales. It's a trick so we don't need to generate the locales in the chroot.
# Something like a prebuilt docker image as base or copying the files from it would be good.
subprocess.run([
'docker',
'run',
@ -80,6 +78,4 @@ else:
'-v',
'/dev:/dev',
#'-v', '/mnt/kupfer:/mnt/kupfer:z',
'-v',
'/usr/share/i18n/locales:/usr/share/i18n/locales:ro'
] + [tag, 'kupferbootstrap'] + sys.argv[1:])