Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 941250 - sys-kernel/genkernel (4.3.16-git) - initramfs assembly fails when temp directory has lower ACL capabilities than source
Summary: sys-kernel/genkernel (4.3.16-git) - initramfs assembly fails when temp direct...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-10 18:57 UTC by Daniel Rozsnyo
Modified: 2024-10-10 18:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Rozsnyo 2024-10-10 18:57:19 UTC
I am running a NFS rootfs node with the temporary folders based on tmpfs (/tmp,/var/tmp).

I have tried to update the kernel, but I can not - as genkernel fails to finish all the necessary steps:

FAIL is located here:

* initramfs: >> Initializing ...
*         >> Appending devices cpio data ...
*         >> Appending base_layout cpio data ...
cp: preserving permissions for '/var/tmp/genkernel/gk_fUUpEKEv/initramfs-base-temp/usr/sbin/gksosreport': Operation not supported
* ERROR: Failed to copy '/usr/share/genkernel/defaults/gksosreport.sh' to '/var/tmp/genkernel/gk_fUUpEKEv/initramfs-base-temp/usr/sbin/gksosreport'
* Please consult '/var/log/genkernel.log' for more information and any
* errors that were reported above.


Since /var/tmp is a tmpfs, I have first tried to check the mount options like noexec and nosuid, and remount the temporary location without then, but these were not the solution.


Running:

# strace cp -avp /usr/share/genkernel/defaults/gksosreport.sh /dev/shm/
'/usr/share/genkernel/defaults/gksosreport.sh' -> '/dev/shm/gksosreport.sh'
cp: preserving permissions for ‘/dev/shm/gksosreport.sh’: Operation not supported


I can pinpoint the failure to this syscall:

fchmod(5, 0100644)                      = 0
flistxattr(4, NULL, 0)                  = 16
flistxattr(4, "system.nfs4_acl\0", 16)  = 16
fgetxattr(4, "system.nfs4_acl", NULL, 0) = 80
fgetxattr(4, "system.nfs4_acl", "\0\0\0\3\0\0\0\0\0\0\0\0\0\26\1\207\0\0\0\6OWNER@\0\0\0\0\0", 80) = 80
fsetxattr(5, "system.nfs4_acl", "\0\0\0\3\0\0\0\0\0\0\0\0\0\26\1\207\0\0\0\6OWNER@\0\0\0\0\0", 80, 0) = -1 EOPNOTSUPP (Operation not supported)


This brings the issue to:

the /, which hosts the source file to copy is an ACL/extended attributes enabled NFS mount.
the /var/tmp, is a tmpfs, without ACL/extended attributes capabilities.


Copying with attribute preservation will fail.


May the build process be changed with less strict copy, or for the purpose of initramfs, could the extended attributes not copied?

Footnote: I have enabled the NFS ACL/EXT attributes recently since last kernel build and reboot - I really do no have in them anything what I know of that I would set them intentionally - so I really do not understand what the copy command tries to achieve - attributes MAY BE PRESENT, not that they are set - I doubt that.


As a workaround, I will recompile the kernel slowly on non-tmpfs temporary location, with enabled extended attributes for tmpfs.