FS#22950 - [kexec-tools] kexec -e fails if /usr is a separate partition

Attached to Project: Arch Linux
Opened by Matteo Sasso (m.sasso) - Friday, 18 February 2011, 17:26 GMT
Last edited by Allan McRae (Allan) - Saturday, 19 February 2011, 03:39 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

The kexec executable is dynamically linked to libraries under /usr (/usr/lib/liblzma.so.5 and /usr/lib/libz.so.1 in kexec-tools-2.0.2-2).
This means that kexec fails (when launched from rc.shutdown) if /usr is a separate partition.

Possible solutions:
1) Change zlib and xz packages so that they install those libraries under /lib.
2) Change kexec so that it installs its own copies of those libraries under /lib.
3) Change the shutdown script so that it remounts /usr read-only instead of unmounting it (doesn't work if /usr is a network share)
4) Change the shutdown script so that it creates a temporary ramdisk, copies all needed libraries before unmounting /usr and LD_PRELOADs them.

Solutions 3) and 4) are a little hackish, and not in a good sense. I could implement solution 4) if asked.
I believe solution 1) is the best, especially since other binaries under /bin and /sbin use them. On my system, for example, they are:

/bin/ping6
/sbin/fsck.cramfs
/sbin/mkfs.cramfs
/sbin/mksquashfs
/sbin/mount.fuse.ntfs
/sbin/unsquashfs

Tell me if I should open bugs for zlib and xz.
This task depends upon

Closed by  Allan McRae (Allan)
Saturday, 19 February 2011, 03:39 GMT
Reason for closing:  Fixed
Additional comments about closing:  kexec-tools 2.0.2-3
Comment by Dave Reisner (falconindy) - Saturday, 19 February 2011, 02:50 GMT
This appears to be a regression of FS7046 -- its not immediately clear how this was fixed

And here's the same bug report in Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=256241 -- they opted for static compilation
Comment by Dave Reisner (falconindy) - Saturday, 19 February 2011, 02:56 GMT
The static build route is also a single line addition to the PKGBUILD:

export LDFLAGS+=" -static"

It builds without error and file reports that it is indeed static:

kexec: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.6.27, stripped

Loading...