修改内核配置路径OKG2L-linux-sdk10里面加载环境变量. environment-setup-aarch64-smarc-rzg2l-toolchain 进入OKG2L-linux-kernel中执行make menuconfig ARCH=arm64 做以下修改 File systems---> DOS/FAT/NT Filesystems --->Default codepage for FAT 改为 936 File systems---> DOS/FAT/NT Filesystems ---> Default iocharset for FAT 改为 utf8 File systems--->Native language support --->Simplified Chinese charset (CP936, GB2312) 选为星号 File systems--->Native language support --->NLS UTF-8 选为星号 File systems--->Native language support --->Default NLS Option 改为utf8
重新编译内核 编译出来的内核镜像在OKG2L-linux-sdk10/images/kernel/Image 参照使用手册重新烧写内核镜像到开发板,或者直接将Image替换到开发板的/boot文件夹中 busybox配置busybox位置:OKG2L-linux-sdk/tools/third**/busybox-1.34.1.tar.bz2 sdk中解压这个,进去执行make menuconfig Settings---> Don't use /usr 选择为星号 Settings---> Cross compiler prefix 填入aarch64-poky-linux- Settings---> Path to sysroot 填入/opt/poky/3.1.5/sysroots/aarch64-poky-linux/ Settings--->Enable locale support (system needs locale for this to work) 选择为星号 Settings--->Support Unicode 选择为星号 Settings--->Character code to substitute unprintable characters with 修改为65533 Settings--->Range of supported Unicode characters 修改为195102
修改./libbb/printable_string.c注释掉0x7f if (c < ' ') break;
s++; } #if ENABLE_UNICODE_SUPPORT dst = unicode_conv_to_printable(stats, str); #else { char *d = dst = xstrdup(str); while (1) { unsigned char c = *d; if (c == '\0') break; if (c < ' ' ) *d = '?'; d++; 修改./libbb/unicode.c注释掉0x7f static char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char *src, unsigned width, int flags) { char *dst; unsigned dst_len; unsigned uni_count; unsigned uni_width; if (unicode_status != UNICODE_ON) { char *d; if (flags & UNI_FLAG_PAD) { d = dst = xmalloc(width + 1); while ((int)--width >= 0) { unsigned char c = *src; if (c == '\0') { do *d++ = ' '; while ((int)--width >= 0); break; } *d++ = (c >= ' ') ? c : '?'; src++; } *d = '\0'; } else { d = dst = xstrndup(src, width); while (*d) { unsigned char c = *d; if (c < ' ') *d = '?'; d++; } } 参照编译手册配置交叉工具编译链environment-setup-aarch64-poky-linux 执行 make –j8 make install 将./_install/bin/busybox复制出来,后面替换到开发板的/usr/bin下面 执行ln -sf /usr/bin/busybox /usr/bin/ls sync之后,reboot重新启动,ls就可以正常显示中文了 测试情况中文.txtroot@okg2l:/run/media/sda1/test/chinese test/Chinese_test# ls 显示中文 显示中文.txt
|