恩山无线论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 819|回复: 1

请教各位 那款OP固件内核带 binfmt 功能

[复制链接]
发表于 2020-11-22 09:51 | 显示全部楼层 |阅读模式
请教各位 那款OP固件内核带 binfmt 功能     docker 跑甜糖用。。

先谢了
我的恩山、我的无线 The best wifi forum is right here.
发表于 2020-11-22 13:28 | 显示全部楼层
本帖最后由 401626436 于 2020-11-22 14:22 编辑

借楼提问:
我想知道的是怎么在openwrt编译qemu的user支持(可以在x86运行arm程序也就是可以直接运行甜糖了)

源码默认的Makefile只有虚拟机的支持 (百度N遍在 ubuntu 用openwrt dl  里的源码测试编译通过)
改Makefile改了N遍都是在编译到user时报错
源码来自
https://git.openwrt.org/feed/packages.git
commit eb1462676df25c89540c42cb059224e4904a13d4
错误信息:
  1. x86_64-openwrt-linux-musl-gcc -iquote /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user -iquote linux-user -iquote /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/tcg/i386 -isystem /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-headers -isystem /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-headers -iquote . -iquote /main/main/build_dir/target-x86_64_musl/qemu-5.0.0 -iquote /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/accel/tcg -iquote /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/include -iquote /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/disas/libvixl -I/main/main/staging_dir/target-x86_64_musl/usr/include/pixman-1   -I/main/main/staging_dir/target-x86_64_musl/usr/include  -I/main/main/staging_dir/target-x86_64_musl/usr/include -pthread -I/main/main/staging_dir/target-x86_64_musl/usr/include/glib-2.0 -I/main/main/staging_dir/target-x86_64_musl/usr/lib/glib-2.0/include  -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99  -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -I/main/main/staging_dir/target-x86_64_musl/usr/lib/libiconv-stub/include -I/main/main/staging_dir/target-x86_64_musl/usr/lib/libintl-stub/include -fmacro-prefix-map=/main/main/build_dir/target-x86_64_musl/qemu-5.0.0=qemu-5.0.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits  -isystem ../linux-headers -iquote .. -iquote /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/target/arm -DNEED_CPU_H -iquote /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/include -I/main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/arm -I/main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/host/x86_64 -I/main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user -Ilinux-user/arm -MMD -MP -MT linux-user/syscall.o -MF linux-user/syscall.d -O2 -O2 -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -I/main/main/staging_dir/target-x86_64_musl/usr/lib/libiconv-stub/include -I/main/main/staging_dir/target-x86_64_musl/usr/lib/libintl-stub/include -fmacro-prefix-map=/main/main/build_dir/target-x86_64_musl/qemu-5.0.0=qemu-5.0.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro   -c -o linux-user/syscall.o /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c
  2. cc1: note: someone does not honour COPTS correctly, passed 2 times
  3. In file included from /main/main/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/include/linux/kernel.h:5,
  4.                  from /main/main/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/include/linux/netlink.h:5,
  5.                  from /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:111:
  6. /main/main/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/include/linux/sysinfo.h:8:8: error: redefinition of 'struct sysinfo'
  7. struct sysinfo {
  8.         ^~~~~~~
  9. In file included from /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:51:
  10. /main/main/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/include/sys/sysinfo.h:10:8: note: originally defined here
  11. struct sysinfo {
  12.         ^~~~~~~
  13. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c: In function 'target_to_host_flock':
  14. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6191:22: error: 'F_EXLCK' undeclared (first use in this function); did you mean 'F_RDLCK'?
  15.      TRANSTBL_CONVERT(F_EXLCK); \
  16.                       ^~~~~~~
  17. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6197:53: note: in definition of macro 'TRANSTBL_CONVERT'
  18. #define TRANSTBL_CONVERT(a) case TARGET_##a: return a
  19.                                                      ^
  20. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6198:5: note: in expansion of macro 'FLOCK_TRANSTBL'
  21.      FLOCK_TRANSTBL
  22.      ^~~~~~~~~~~~~~
  23. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6191:22: note: each undeclared identifier is reported only once for each function it appears in
  24.      TRANSTBL_CONVERT(F_EXLCK); \
  25.                       ^~~~~~~
  26. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6197:53: note: in definition of macro 'TRANSTBL_CONVERT'
  27. #define TRANSTBL_CONVERT(a) case TARGET_##a: return a
  28.                                                      ^
  29. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6198:5: note: in expansion of macro 'FLOCK_TRANSTBL'
  30.      FLOCK_TRANSTBL
  31.      ^~~~~~~~~~~~~~
  32. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6192:22: error: 'F_SHLCK' undeclared (first use in this function); did you mean 'F_RDLCK'?
  33.      TRANSTBL_CONVERT(F_SHLCK); \
  34.                       ^~~~~~~
  35. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6197:53: note: in definition of macro 'TRANSTBL_CONVERT'
  36. #define TRANSTBL_CONVERT(a) case TARGET_##a: return a
  37.                                                      ^
  38. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6198:5: note: in expansion of macro 'FLOCK_TRANSTBL'
  39.      FLOCK_TRANSTBL
  40.      ^~~~~~~~~~~~~~
  41. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c: In function 'host_to_target_flock':
  42. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6191:22: error: 'F_EXLCK' undeclared (first use in this function); did you mean 'F_RDLCK'?
  43.      TRANSTBL_CONVERT(F_EXLCK); \
  44.                       ^~~~~~~
  45. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6205:34: note: in definition of macro 'TRANSTBL_CONVERT'
  46. #define TRANSTBL_CONVERT(a) case a: return TARGET_##a
  47.                                   ^
  48. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6206:5: note: in expansion of macro 'FLOCK_TRANSTBL'
  49.      FLOCK_TRANSTBL
  50.      ^~~~~~~~~~~~~~
  51. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6192:22: error: 'F_SHLCK' undeclared (first use in this function); did you mean 'F_RDLCK'?
  52.      TRANSTBL_CONVERT(F_SHLCK); \
  53.                       ^~~~~~~
  54. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6205:34: note: in definition of macro 'TRANSTBL_CONVERT'
  55. #define TRANSTBL_CONVERT(a) case a: return TARGET_##a
  56.                                   ^
  57. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6206:5: note: in expansion of macro 'FLOCK_TRANSTBL'
  58.      FLOCK_TRANSTBL
  59.      ^~~~~~~~~~~~~~
  60. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c: In function 'target_to_host_sigevent':
  61. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6794:16: error: 'struct sigevent' has no member named '_sigev_un'; did you mean 'sigev_value'?
  62.      host_sevp->_sigev_un._tid = tswap32(target_sevp->_sigev_un._tid);
  63.                 ^~~~~~~~~
  64.                 sigev_value
  65. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c: In function 'host_to_target_stat64':
  66. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6845:5: warning: "_POSIX_C_SOURCE" is not defined, evaluates to 0 [-Wundef]
  67. #if _POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
  68.      ^~~~~~~~~~~~~~~
  69. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6845:35: warning: "_XOPEN_SOURCE" is not defined, evaluates to 0 [-Wundef]
  70. #if _POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
  71.                                    ^~~~~~~~~~~~~
  72. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6880:5: warning: "_POSIX_C_SOURCE" is not defined, evaluates to 0 [-Wundef]
  73. #if _POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
  74.      ^~~~~~~~~~~~~~~
  75. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:6880:35: warning: "_XOPEN_SOURCE" is not defined, evaluates to 0 [-Wundef]
  76. #if _POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
  77.                                    ^~~~~~~~~~~~~
  78. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c: In function 'do_syscall1':
  79. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:9502:6: warning: "_POSIX_C_SOURCE" is not defined, evaluates to 0 [-Wundef]
  80. #if (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) && \
  81.       ^~~~~~~~~~~~~~~
  82. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:9502:36: warning: "_XOPEN_SOURCE" is not defined, evaluates to 0 [-Wundef]
  83. #if (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) && \
  84.                                     ^~~~~~~~~~~~~
  85. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:9564:37: warning: passing argument 1 of 'sysinfo' from incompatible pointer type [-Wincompatible-pointer-types]
  86.              ret = get_errno(sysinfo(&value));
  87.                                      ^~~~~~
  88. In file included from /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/linux-user/syscall.c:51:
  89. /main/main/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/include/sys/sysinfo.h:26:14: note: expected 'struct sysinfo *' but argument is of type 'struct sysinfo *'
  90. int sysinfo (struct sysinfo *);
  91.               ^~~~~~~~~~~~~~~~
  92. /main/main/build_dir/target-x86_64_musl/qemu-5.0.0/rules.mak:69: recipe for target 'linux-user/syscall.o' failed
  93. make[4]: *** [linux-user/syscall.o] Error 1
  94. make[4]: Leaving directory '/main/main/build_dir/target-x86_64_musl/qemu-5.0.0/arm-linux-user'
  95. Makefile:527: recipe for target 'arm-linux-user/all' failed
  96. make[3]: *** [arm-linux-user/all] Error 2
  97. make[3]: Leaving directory '/main/main/build_dir/target-x86_64_musl/qemu-5.0.0'
  98. Makefile:455: recipe for target '/main/main/build_dir/target-x86_64_musl/qemu-5.0.0/.built' failed
  99. make[2]: *** [/main/main/build_dir/target-x86_64_musl/qemu-5.0.0/.built] Error 2
  100. make[2]: Leaving directory '/main/main/feeds/packages/utils/qemu'
  101. time: package/feeds/packages/qemu/compile#519.16#52.38#583.14
  102. package/Makefile:112: recipe for target 'package/feeds/packages/qemu/compile' failed
  103. make[1]: *** [package/feeds/packages/qemu/compile] Error 2
  104. make[1]: Leaving directory '/main/main'
  105. /main/main/include/toplevel.mk:240: recipe for target 'package/feeds/packages/qemu/compile' failed
  106. make: *** [package/feeds/packages/qemu/compile] Error 2
复制代码




顺便回复贴主的问题:
可以自己编译
make kernel_menuconfig
Executable file formats
Kernel support for MISC binaries

或者假如你的内核是5.4.xxx
/target/linux/generic/config-5.4
添加 CONFIG_BINFMT_MISC=y
重新编译


懒就直接论坛里搜索也至少有3-4个固件(固件贴主说支持我没用过)






我的恩山、我的无线 The best wifi forum is right here.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )|网站地图

GMT+8, 2020-12-4 04:56

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表