Skip to content

Conversation

@yzewei
Copy link
Contributor

@yzewei yzewei commented Jan 22, 2026

The following are fixes for running Docker containers on box64:

Runtime Environment:

Hardware: loongarch64

Kernel: 6.6.0-130.0.0.107.loongarch64

box64: main

x86 container: debian:sid-slim

Specific modifications:

wrappedlibtinfo6:

GO added _nc_basename, _nc_is_abs_path, _nc_rootname, and use_tioctl.
GOM added _nc_tiparm, del_curterm, set_curterm, and setupterm.
DATAM added cur_term.
The above modifications are due to errors encountered during the clear/reset translation runtime.

cur_term, as a pointer to a TERMINAL type structure, needs to be encapsulated by DATAM. Because ncurses generally uses reentrant as a build parameter, the global symbol cur_term will not be updated. The actual pointer is stored in _nc_prescreen._cur_term or SCREEN->_term, and cur_term cannot be directly accessed. Therefore, a layout-matched TERMINAL shadow needs to be constructed.

wrappedselinux:

GO added setfilecon to fix missing symbols in the find function.
GO added context_free context_new context_str context_type_get context_type_set getcon_raw getfscreatecon_raw mode_to_security_class security_compute_create_raw ...

@yzewei yzewei marked this pull request as draft January 22, 2026 12:13
@yzewei
Copy link
Contributor Author

yzewei commented Jan 22, 2026

PTAL!

@ptitSeb
Copy link
Owner

ptitSeb commented Jan 22, 2026

For Global symbol like NCurses uses, they are some limitation with box64 wrapping... So I have added some hack to workaround those limitation. Take a look at librarian/globalsymbols.c to see how they are handled. You'll see that cur_term is already there. But indeed, it's not wrapped in tfinfo6... so strange.

You should not need to DATAM(cur_term), like for the other global variables... But what be missing probably is the appropriate calls to my_updateGlobalTInfo(); and my_checkGlobalTInfo() at the right place, like with my6_initscr() for the ncurses6 version of it.

@yzewei
Copy link
Contributor Author

yzewei commented Jan 23, 2026

For Global symbol like NCurses uses, they are some limitation with box64 wrapping... So I have added some hack to workaround those limitation. Take a look at librarian/globalsymbols.c to see how they are handled. You'll see that cur_term is already there. But indeed, it's not wrapped in tfinfo6... so strange.

You should not need to DATAM(cur_term), like for the other global variables... But what be missing probably is the appropriate calls to my_updateGlobalTInfo(); and my_checkGlobalTInfo() at the right place, like with my6_initscr() for the ncurses6 version of it.

This can be resolved by pushing a new commit.

@yzewei yzewei force-pushed the miss-symbol branch 3 times, most recently from ff69ba4 to f67c676 Compare January 23, 2026 07:24
@yzewei yzewei marked this pull request as ready for review January 23, 2026 07:35
@yzewei yzewei changed the title [WRAPPER] wrape ncurses curterm via set_curterm; add selinux setfilecon [WRAPPER] wrape ncurses curterm via set_curterm; add selinux symbol to (mkdir, find) Jan 23, 2026
@yzewei yzewei requested a review from ptitSeb January 23, 2026 09:16
@ptitSeb ptitSeb changed the title [WRAPPER] wrape ncurses curterm via set_curterm; add selinux symbol to (mkdir, find) [WRAPPER] wrapped ncurses curterm via set_curterm; add selinux symbol to (mkdir, find) Jan 23, 2026
Signed-off-by: Zewei Yang <yangzewei@loongson.cn>
@ptitSeb
Copy link
Owner

ptitSeb commented Jan 23, 2026

Thanks, merging this now.

@ptitSeb ptitSeb merged commit 361d71b into ptitSeb:main Jan 23, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants