Fix glibc locales
Fixes https://gitlab.com/kupfer/kupferbootstrap/-/issues/11
This commit is contained in:
parent
6ec0c3cf39
commit
35ec53b615
2 changed files with 22 additions and 4 deletions
22
packages.py
22
packages.py
|
@ -338,6 +338,28 @@ def build_package(package: Package):
|
||||||
|
|
||||||
if package.mode == 'cross':
|
if package.mode == 'cross':
|
||||||
logging.info(f'Cross-compiling {package.path}')
|
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(
|
result = subprocess.run(
|
||||||
makepkg_cmd + makepkg_compile_opts,
|
makepkg_cmd + makepkg_compile_opts,
|
||||||
env=makepkg_cross_env | {'QEMU_LD_PREFIX': '/usr/aarch64-linux-gnu'},
|
env=makepkg_cross_env | {'QEMU_LD_PREFIX': '/usr/aarch64-linux-gnu'},
|
||||||
|
|
|
@ -58,8 +58,6 @@ else:
|
||||||
|
|
||||||
atexit.register(at_exit)
|
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([
|
subprocess.run([
|
||||||
'docker',
|
'docker',
|
||||||
'run',
|
'run',
|
||||||
|
@ -80,6 +78,4 @@ else:
|
||||||
'-v',
|
'-v',
|
||||||
'/dev:/dev',
|
'/dev:/dev',
|
||||||
#'-v', '/mnt/kupfer:/mnt/kupfer:z',
|
#'-v', '/mnt/kupfer:/mnt/kupfer:z',
|
||||||
'-v',
|
|
||||||
'/usr/share/i18n/locales:/usr/share/i18n/locales:ro'
|
|
||||||
] + [tag, 'kupferbootstrap'] + sys.argv[1:])
|
] + [tag, 'kupferbootstrap'] + sys.argv[1:])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue