FS#18146 - [cryptsetup] 1.1.0-1 creates broken cryptsetup.static

Attached to Project: Arch Linux
Opened by Christian Neukirchen (chneukirchen) - Wednesday, 03 February 2010, 18:37 GMT
Last edited by Thomas Bächler (brain0) - Tuesday, 10 August 2010, 11:53 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
cryptsetup-1.1.0-1 (65135) creates broken cryptsetup.static since it copies a libtool
stub and not the actual binary file (which isn't even statically linked...).

Steps to reproduce:
% cd cryptsetup
% makepkg
% file src/cryptsetup-1.1.0/src/cryptsetup
src/cryptsetup-1.1.0/src/cryptsetup: a /bin/sh script text executable
% file src/cryptsetup-1.1.0/src/.libs/cryptsetup
... dynamically linked ...

This stub gets installed as /sbin/cryptsetup.static!
(And it's hard to notice since the path is hardcoded, so it will look like it works
if you don't "make clean".)

Building it myself results in "Your system requires SElinux libraries" errors.
I hacked that out in configure.in, then it worked, and builds a proper static binary.

I think this is of high severity since it will make invalid initrds, thus making
the system unbootable.
This task depends upon

Closed by  Thomas Bächler (brain0)
Tuesday, 10 August 2010, 11:53 GMT
Reason for closing:  Deferred
Additional comments about closing:  We hope to never need static binaries again. Ever.
Comment by Thomas Bächler (brain0) - Wednesday, 03 February 2010, 19:05 GMT
Also initscripts use /sbin/cryptsetup.static. I am going to get rid of the static binary for both initramfs and initscripts anyway.

However, I can't reproduce your problem, at least I can execute the cryptsetup.static binaries on both architectures here and they give me a usage message.
Comment by Christian Neukirchen (chneukirchen) - Wednesday, 03 February 2010, 19:32 GMT
Check them with file if it really area statically linked binaries.

I did this on a very fresh Arch install, maybe you have some headers that I don't and thus the build runs correctly.

Does ./configure --enable-static build for you?

(And please keep the static binaries, it makes a chroot that can lock and unlock the root partition so much easier...)
Comment by Thomas Bächler (brain0) - Wednesday, 03 February 2010, 19:33 GMT
$ file /sbin/cryptsetup.static
/sbin/cryptsetup.static: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.6.18, stripped
$ file /mnt/arch32/sbin/cryptsetup.static
/mnt/arch32/sbin/cryptsetup.static: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.18, stripped
Comment by Christian Neukirchen (chneukirchen) - Wednesday, 03 February 2010, 20:01 GMT
A more detailed buildlog:

[chris@myhost cryptsetup]$ makepkg^M
^[[1;32m==>^[[1;0m^[[1;1m Making package: cryptsetup 1.1.0-1 i686 (Wed Feb 3 20\:56:46 UTC 2010)^[[1;0m^M
...
^[[1;32m==>^[[1;0m^[[1;1m Starting build()...^[[1;0m^M
checking for a BSD-compatible install... /bin/install -c^M
...
config.status: creating po/Makefile^M
make all-recursive^M
...
make[1]: Leaving directory `/home/chris/cryptsetup/src/cryptsetup-1.1.0'^M
checking for a BSD-compatible install... /bin/install -c^M
...
checking for dm_task_set_name in -ldevmapper... yes^M
checking for dm_task_set_message in -ldevmapper... yes^M
checking for sepol_bool_set in -lsepol... no^M
checking for is_selinux_enabled in -lselinux... no^M
checking for library containing pthread_mutex_lock... -lpthread^M
checking for library containing dm_set_selinux_context... no^M
configure: error: Your system requires SElinux libraries for static compilation.\^M
make all-recursive^M
...
^[[1;32m==>^[[1;0m^[[1;1m Finished making: cryptsetup 1.1.0-1 i686 (Wed Feb 3 2\0:57:21 UTC 2010)^[[1;0m^M
...
[chris@myhost cryptsetup]$ file src/cryptsetup-1.1.0/src/cr^Gyptsetup^M
src/cryptsetup-1.1.0/src/cryptsetup: a /bin/sh script text executable^M


Since the second configure fails here, it gets rebuild dynamically again here.

Perhaps the PKGBUILD is only missing some dependency (the selinux thing), but I can't find it.
Comment by Roman Kyrylych (Romashka) - Tuesday, 10 August 2010, 10:01 GMT
what's the status with 1.1.3-1?
Comment by Christian Neukirchen (chneukirchen) - Tuesday, 10 August 2010, 10:15 GMT
Since 1.1.3-1 doesn't build a static binary anymore and the initrd uses busybox now, this bug is irrelevant.

Loading...