Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 869725

Summary: genkernel --logfile in build directory results in sandbox violations
Product: Gentoo Hosted Projects Reporter: Fedja Beader <fedja>
Component: genkernelAssignee: Gentoo Genkernel Maintainers <genkernel>
Status: UNCONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Fedja Beader 2022-09-11 14:57:07 UTC
The first part of a genkernel-managed kernel build (building the kernel itself) goes fine and the logfile grows. However, the second part that presumably builds the initramfs is failing due to sandbox violations.


Perhaps the logfile should be added to sandbox whitelist?

Reproducible: Always

Steps to Reproduce:
The genkernel invocation (cwd is /usr/src/build-4.9.326-gentoo):
#!/bin/bash

printf -v t "kbuild.%(%Y.%m.%d-%H:%M)T.log" "-1"
time genkernel \
    --no-clean \
    --no-mrproper \
    --loglevel=5 \
    --logfile="$t" \
    --no-menuconfig \
    --compress-initrd \
    --compress-initramfs-type=best \
    --luks \
    --lvm \
    --no-ramdisk-modules \
    --no-all-ramdisk-modules \
    --kerneldir="$PWD/source" \
    --kernel-outputdir="$PWD" \
    all

Actual Results:  
The errors (excerp from terminal, the sandbox log file does not exist at the stated place)

libtool: install: x86_64-pc-linux-gnu-ranlib /var/tmp/genkernel/gk_Av2L7liY/util-linux/image/usr/lib/libmount.a                                                       [5767/9288]
libtool: warning: remember to run 'libtool --finish /usr/lib'
*                 util-linux-2.37.2: >> Creating binpkg ...
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log
/usr/share/genkernel/gen_funcs.sh: line 175: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log
/usr/share/genkernel/gen_funcs.sh: line 184: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied
* Scanning for dynamically linked programs ...                                                                                                                                   
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 175: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 184: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
* QA_IGNORE_DYNAMICALLY_LINKED_PROGRAM is not set; Not checking '/sbin/blkid' for exclusion ...                                                                                  
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 175: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 184: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied       
* QA_IGNORE_DYNAMICALLY_LINKED_PROGRAM is not set; Not checking '/sbin/switch_root' for exclusion ...                                                                            
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 175: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 184: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
COMMAND: /bin/tar -c -I 'xz -T3' -pf /var/cache/genkernel/4.2.6/util-linux-2.37.2-x86_64.tar.xz .                                                                                
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log
/usr/share/genkernel/gen_funcs.sh: line 175: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 184: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
* Final size of build root:      4.0K                                                                                                                                            
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 175: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 184: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
* Final size of build directory: 73M                                                                                                                                             
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 175: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 184: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
* Final size of installed tree:  4.3M                                                                                                                                            
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 175: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
 * ACCESS DENIED:  open_wr:       /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log                                                                                      
/usr/share/genkernel/gen_funcs.sh: line 184: /usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log: Permission denied                                                        
 * ----------------------- SANDBOX ACCESS VIOLATION SUMMARY -----------------------                                                                                              
 * LOG FILE: "/var/tmp/genkernel/gk_Av2L7liY/sandbox_vn60ae.log"                                                                                                                 
 *




The setup:
/usr/src/linux-4.9.326-gentoo  contains the kernel sources, as installed by "emerge gentoo-sources"
/usr/src/build-4.9.326-gentoo  contains the build files.
/usr/src/build-4.9.326-gentoo/kbuild.2022.09.10-23:41.log is the log file (--logfile=the above)

kernel & system map are both installed to /boot, initramfs is missing.