mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-19 17:02:15 +00:00
09e277a6a1
An Ubuntu node that netboots legacy Genesis dies with Failed to execute /init (error -13) Kernel panic - not syncing: No working init found. xCAT-genesis-base/debian/rules is a bare `dh $@`, so dh_fixperms applies its *.so* rule to the whole package. That is right for a Debian shared library and wrong for a netboot ROOT FILESYSTEM: the kernel execs the payload's dynamic loader, and a loader with no execute bit makes open_exec() return EACCES, so every ELF in the image fails to start. mknb copies the tree verbatim into genesis.fs.<arch>.lzma, so the mode travels into the image. The pipeline's iPXE command line carries `quiet`, which hid the reason. Measured on xcat-master-ub from the installed package: 644 .../netboot/genesis/x86_64/fs/usr/lib64/ld-linux-x86-64.so.2 755 .../netboot/genesis/x86_64/fs/usr/bin/basename and reproduced away from the lab: that management node's own kernel and image under qemu panicked at 35 seconds, a repack with no change panicked again, and a repack with only chmod 0755 on the loader reached /init and started dracut. The EL rpm is unaffected, because it never runs dh_fixperms. This is why only the Ubuntu genesis-legacy cell saw it, and why that cell has never had a non-mock green. It is not a regression: the same recipe builds the published xcat-genesis-base-amd64. The bit is restored AFTER dh_fixperms rather than excluding the tree with -X, which would also skip its chown 0:0 pass and ship the payload owned by the build user. genesis_deb_loader_executable.t asserts the override exists, still calls dh_fixperms, is scoped to the netboot tree, names both the glibc and the ppc64le loader, and runs the chmod AFTER dh_fixperms. Three of its ten assertions fail without the override, and the ordering assertion fails if the chmod is moved first -- which is the mistake that looks correct. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
28 lines
949 B
Makefile
Executable File
28 lines
949 B
Makefile
Executable File
#!/usr/bin/make -f
|
|
|
|
%:
|
|
dh $@
|
|
|
|
override_dh_auto_build:
|
|
@true
|
|
|
|
override_dh_auto_test:
|
|
@true
|
|
|
|
override_dh_auto_install:
|
|
@true
|
|
|
|
# dh_fixperms resets every *.so* in the package to 0644, which is right for a Debian shared
|
|
# library and wrong for a netboot ROOT FILESYSTEM. The kernel execs the payload's dynamic loader,
|
|
# and a loader with no execute bit makes open_exec() return EACCES, so every ELF in the Genesis
|
|
# image fails to start and the node panics with "No working init found". mknb copies the tree
|
|
# verbatim into genesis.fs.<arch>.lzma, so the mode travels into the image.
|
|
#
|
|
# The bit is restored AFTER dh_fixperms rather than excluding the tree with -X, which would also
|
|
# skip its chown 0:0 pass and ship the payload owned by the build user.
|
|
override_dh_fixperms:
|
|
dh_fixperms
|
|
find debian/*/opt/xcat/share/xcat/netboot/genesis -type f \
|
|
\( -name 'ld-*.so' -o -name 'ld-*.so.*' -o -name 'ld64.so.*' \) \
|
|
-exec chmod 0755 {} +
|