ilbers / isar

Integration System for Automated Root filesystem generation
Other
177 stars 72 forks source link

linux-custom: linux-header: copy selinux headers #67

Closed arulcse2008 closed 3 years ago

arulcse2008 commented 3 years ago

Copy the selinux headers, as it is required to build scripts on target

root@iot2050:/usr/src/linux-headers-4.19.165-cip41-rt18+mel6# make scripts ... HOSTCC scripts/selinux/genheaders/genheaders scripts/selinux/genheaders/genheaders.c:18:10: fatal error: classmap.h: No such file or directory

include "classmap.h"

      ^~~~~~~~~~~~

compilation terminated.

Signed-off-by: Arulpandiyan Vadivel arulpandiyan_vadivel@mentor.com

jan-kiszka commented 3 years ago

Please use the mailing list. And we still need to clarify the status and possibly resolution for Debian's kernel-headers package.

arulcse2008 commented 3 years ago

Please use the mailing list. And we still need to clarify the status and possibly resolution for Debian's kernel-headers package.

Send a bug over email submit@bugs.debian.org.

arulcse2008 commented 3 years ago

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988367 Bug raised.

ismagulb commented 3 years ago

Hello Arulpandiyan,

I'd suggest to move this discussion to cip-dev@lists.cip-project.org or isar-users@googlegroups.com. IIUC, classmap.h is an internal header not intended for user space, so I suppose we shouldn't add it to linux-headers. If you build genheaders from within the kernel source tree, the error should not happen:

wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.19.165.tar.gz
tar zxf linux-4.19.165.tar.gz
cd linux-4.19.165
make defconfig
make scripts; echo $?
  HOSTCC  scripts/selinux/genheaders/genheaders
0

I don't know what is inside linux-headers-4.19.165-cip41-rt18+mel6, but the "headers" part doesn't sound right. Maybe you could share how the problem could be reproduced.

arulcse2008 commented 3 years ago

Hello Arulpandiyan,

I'd suggest to move this discussion to cip-dev@lists.cip-project.org or isar-users@googlegroups.com. IIUC, classmap.h is an internal header not intended for user space, so I suppose we shouldn't add it to linux-headers. If you build genheaders from within the kernel source tree, the error should not happen:

wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.19.165.tar.gz
tar zxf linux-4.19.165.tar.gz
cd linux-4.19.165
make defconfig
make scripts; echo $?
  HOSTCC  scripts/selinux/genheaders/genheaders
0

I don't know what is inside linux-headers-4.19.165-cip41-rt18+mel6, but the "headers" part doesn't sound right. Maybe you could share how the problem could be reproduced.

Hello Ismagulb

We had a requirement to build the kernel scripts on the target itself where we don't have a kernel directory and only have /usr/src/linux-headers-${uname -r} directory. Also note that SELINUX is enabled in 4.19.165-cip41-rt18+mel6 kernel.
root@iot2050:/usr/src/linux-headers-4.19.165-cip41-rt18+mel6# make scripts
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACC    scripts/kconfig/zconf.tab.c
  LEX     scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --syncconfig Kconfig
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  LEX     scripts/dtc/dtc-lexer.lex.c
  YACC    scripts/dtc/dtc-parser.tab.h
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  YACC    scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTLD  scripts/dtc/fdtoverlay
  YACC    scripts/genksyms/parse.tab.h
  HOSTCC  scripts/genksyms/genksyms.o
  YACC    scripts/genksyms/parse.tab.c
  HOSTCC  scripts/genksyms/parse.tab.o
  LEX     scripts/genksyms/lex.lex.c
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/empty.o
  MKELF   scripts/mod/elfconfig.h
  CC      scripts/mod/devicetable-offsets.s
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  HOSTCC  scripts/selinux/genheaders/genheaders
scripts/selinux/genheaders/genheaders.c:18:10: fatal error: classmap.h: No such file or directory
 #include "classmap.h"
          ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.host:90: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:544: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:544: scripts/selinux] Error 2
make: *** [Makefile:1092: scripts] Error 2
root@iot2050:/usr/src/linux-headers-4.19.165-cip41-rt18+mel6#
arulcse2008 commented 3 years ago

Closing this PR, As per the standard procedures, we should not expose kernel headers. Hence updated the document to rebuild the kernel header from source code https://confluence.alm.mentorg.com/display/PS/Omni-2.2+Recompile+Headers+Scripts