Hi, I installed cryptsetup for using an encrypted swap partiton. After patching cryptsetup with --- snip --- diff -urN cryptsetup-0.1.old/src/libdevmapper.c cryptsetup-0.1/lib/libdevmapper.c --- cryptsetup-0.1.old/src/libdevmapper.c 2004-06-03 16:33:44.000000000 +0200 +++ cryptsetup-0.1/src/libdevmapper.c 2005-12-25 10:54:38.000000000 +0100 @@ -226,6 +226,11 @@ if (!dm_task_get_info(dmt, &dmi)) goto out; + if (!dmi.exists) { + r = -ENODEV; + goto out; + } + next = dm_get_next_target(dmt, next, &start, &length, &target_type, ¶ms); if (!target_type || strcmp(target_type, CRYPT_TARGET) != 0 || --- snap --- I got my swap encrypted. Now by trying emerge -uDp world (Yes, I know, there are sone people outside there telling me, why do you use -D...), I get the following problem: [blocks B ] sys-fs/cryptsetup (is blocking sys-fs/cryptsetup-luks-1.0.1-r1) [blocks B ] sys-fs/cryptsetup-luks (is blocking sys-fs/cryptsetup-0.1-r2) I do not use cryptsetup-luks, because it does not work here (maybe another bug report required). Following http://www.gentoo.org/proj/en/hardened/disk-cryptography.xml I installed cryptsetup. So, it seems pmount needs cryptsetup-luks? Would it work by just using any version of cryptsetup? Regards Christian Gentoo Base System version 1.12.0_pre15 Portage 2.1_pre4-r1 (default-linux/amd64/2005.1, gcc-4.0.2, glibc-2.3.6-r2, 2.6.15-suspend2-r4 x86_64) ================================================================= System uname: 2.6.15-suspend2-r4 x86_64 AMD Athlon(tm) 64 Processor 3200+ ccache version 2.4 [enabled] dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1-r1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r3 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="" ALSA_CARDS="intel8x0 emu10k1" ANT_HOME="/usr/share/ant-core" ARCH="amd64" AUTOCLEAN="yes" BASH_ENV="/etc/spork/is/not/valid/profile.env" CBUILD="x86_64-pc-linux-gnu" CCACHE_DIR="/var/tmp/.ccache_64" CCACHE_SIZE="2G" CDEFINE_amd64="__x86_64__" CDEFINE_x86="__i386__" CFLAGS="-O2 -march=athlon64 -pipe" CFLAGS_x86="-m32 -L/emul/linux/x86/lib -L/emul/linux/x86/usr/lib" CHOST="x86_64-pc-linux-gnu" CHOST_amd64="x86_64-pc-linux-gnu" CHOST_x86="i686-pc-linux-gnu" CLASSPATH="." CLEAN_DELAY="5" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/texmf/web2c /etc/env.d" CVS_RSH="ssh" CXXFLAGS="-O2 -march=athlon64 -pipe" DCCC_PATH="/usr/lib/distcc/bin" DEFAULT_ABI="amd64" DISPLAY=":0.0" DISTCC_DIR="/var/tmp/.distcc" DISTCC_LOG="" DISTCC_VERBOSE="0" DISTDIR="/usr/portage/distfiles" EDITOR="/usr/bin/vim" ELIBC="glibc" EMERGE_WARNING_DELAY="10" FEATURES="autoconfig ccache digest distlocks prelink sandbox sfperms strict" FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --no-check-certificate ${URI} -P ${DISTDIR}" FLTK_DOCDIR="/usr/share/doc/fltk-1.1.7/html" FRITZCAPI_CARDS="fcusb2" GCC_SPECS="" GDK_USE_XFT="1" GDM_LANG="de_DE.utf8" GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://gentoo.inode.at/source/ ftp://ftp.easynet.nl/mirror/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo" GUILE_LOAD_PATH="/usr/share/guile/1.6" G_BROKEN_FILENAMES="1" HISTCONTROL="ignoredups:erasedups" HOME="/root" HOSTNAME="amd64" INFOPATH="/usr/share/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.16.1/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.0.2/info" INPUT_DEVICES="evdev keyboard mouse " JAVAC="/opt/blackdown-jdk-1.4.2.03/bin/javac" JAVA_HOME="/opt/blackdown-jdk-1.4.2.03" JDK_HOME="/opt/blackdown-jdk-1.4.2.03" KERNEL="linux" LADSPA_PATH="/usr/lib64/ladspa" LANG="de_DE.utf8" LC_ALL="de_DE.utf8" LDFLAGS_x86="-m elf_i386 -L/emul/linux/x86/lib -L/emul/linux/x86/usr/lib" LESS="-R -M --shift 5" LESSOPEN="|lesspipe.sh %s" LIBDIR_amd64="lib64" LIBDIR_x86="lib32" LINGUAS="de" LOGNAME="root" LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.qt=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.flac=01;35:*.mp3=01;35:*.mpc=00;36:*.ogg=00;36:*.wav=00;36:*.mid=00;36:*.midi=00;36:*.au=00;36:*.flac=00;36:*.aac=00;36:" MAKEOPTS="-j3" MANPATH="/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.16.1/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.0.2/man::/opt/blackdown-jdk-1.4.2.03/man" MULTILIB_ABIS="x86 amd64" MULTILIB_STRICT_DENY="64-bit.*shared object" MULTILIB_STRICT_DIRS="/lib /usr/lib /usr/kde/*/lib /usr/qt/*/lib /usr/X11R6/lib" MULTILIB_STRICT_EXEMPT="(perl5|gcc|gcc-lib|eclipse-3|debug|portage)" OLDPWD="/usr/local/overlays/portage/sys-fs/cryptsetup-luks" OPENGL_PROFILE="nvidia" PAGER="/usr/bin/less" PATH="/root/bin:/usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.0.2:/opt/Acrobat7:/opt/blackdown-jdk-1.4.2.03/bin:/opt/blackdown-jdk-1.4.2.03/jre/bin" PKGDIR="/usr/portage/packages" PORTAGE_ARCHLIST="ppc s390 amd64 ppc64 m68k arm sparc sh mips ia64 alpha ppc-macos hppa x86" PORTAGE_BINHOST_CHUNKSIZE="3000" PORTAGE_CALLER="emerge" PORTAGE_ELOG_CLASSES="info warn error log" PORTAGE_ELOG_MAILURI="root@localhost localhost" PORTAGE_ELOG_SYSTEM="save mail" PORTAGE_GID="250" PORTAGE_MASTER_PID="953" PORTAGE_TMPDIR="/var/tmp" PORTAGE_TMPFS="/dev/shm" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/overlays/portage" PRELINK_PATH="" PRELINK_PATH_MASK="/usr/lib/gstreamer-0.8:/lib/modules:/usr/lib64/locale:/usr/lib64/wine:/usr/lib64/valgrind:*.la:*.png:*.py:*.pl:*.pm:*.sh:*.xml:*.xslt:*.a:*.js:/usr/lib/klibc" PWD="/usr/local/overlays/portage/sys-fs" PYTHONDOCS="/usr/share/doc/python-docs-2.4.2/html" PYTHONPATH="/usr/lib/portage/pym" QTDIR="/emul/linux/x86/usr/qt/2:/emul/linux/x86/usr/qt/3" RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --no-check-certificate ${URI} -P ${DISTDIR}" RPMDIR="/usr/portage/rpm" RSYNC_RETRIES="3" RSYNC_TIMEOUT="180" SANE_CONFIG_DIR="/etc/sane.d" SHELL="/bin/bash" SHLVL="1" SYMLINK_LIB="yes" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" TERM="xterm" USE="amd64 X X509 a52 aac acpi acpi4linux activefilter alsa apache2 avi bcmath berkdb bigger-fonts bitmap-fonts bluetooth browserplugin bzlib cairo caps cddb cdparanoia chroot client codecs crypt css ctype cups dbm dbus dga dhcp dlloader doc dri dvd dvdr dvdread dxr3 eds emboss encode extensions faac faad fame fax faxonly fbcon fbsplash firefox font-server foomaticdb freetype fuse gif gimp gimpprint glitz gnome gpm gstreamer gtk gtk2 hbci icq icu imap imlib ipv6 javascript jbig jpeg jpeg2k lcd libclamav lm_sensors logrotate lzo lzw lzw-tiff maildir mailwrapper mbox md5sum mime mjpeg mp3 mpeg mpeg4 mppe-mppc nautilus ncurses network nls no-old-linux nptl nptlonly nsplugin nvidia oggvorbis opengl oss pam password pcntl pdflib perl php pic png pnp posix ppds python quicktime readline rtc sdl session sftplogging sockets sox spell ssl subversion symlink tcpd theora threads tiff tokenizer truetype-fonts type1-fonts unicode usb userlocales vcd vim-with-x wxwindows xpm xprint xrandr xscreensaver xsl xv zlib elibc_glibc fritzcapi_cards_fcusb2 input_devices_evdev input_devices_keyboard input_devices_mouse kernel_linux linguas_de userland_GNU video_cards_apm video_cards_v4l video_cards_nvidia video_cards_nv" USER="root" USERLAND="GNU" USE_EXPAND="DVB_CARDS ELIBC FCDSL_CARDS FRITZCAPI_CARDS INPUT_DEVICES KERNEL LINGUAS USERLAND VIDEO_CARDS" USE_EXPAND_HIDDEN="" USE_ORDER="env:pkg:conf:defaults" VIDEO_CARDS="apm v4l nvidia nv" XARGS="xargs -r" XAUTHORITY="/root/.xauthICIsbM" _="/usr/bin/emerge" use_Mesa="no"
Here is the reason, why I can not use cryptsetup-luks: amd64 ~ # gdb /bin/cryptsetup GNU gdb 6.4 Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run -d /dev/urandom create crypt-swap /dev/sda6 Starting program: /bin/cryptsetup -d /dev/urandom create crypt-swap /dev/sda6 Program received signal SIGSEGV, Segmentation fault. 0x000000000040737f in dm_query_device () (gdb) bt #0 0x000000000040737f in dm_query_device () #1 0x0000000000405312 in __crypt_create_device () #2 0x0000000000405ed8 in crypt_job () #3 0x0000000000400498 in action_create () #4 0x0000000000400e49 in main () Tested with USE-flag +/-dynamic and FEATURES set to nostrip debug I reemerged device-mapper and cryptsetup-luks. Same problem. Even downgrading device-mapper does not change anything. If using the dynamic use flag, the error output of cryptsetup-luks changes from a seg-fault to: Command failed: Invalid argument So you can see, I really don
Here is the reason, why I can not use cryptsetup-luks: amd64 ~ # gdb /bin/cryptsetup GNU gdb 6.4 Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run -d /dev/urandom create crypt-swap /dev/sda6 Starting program: /bin/cryptsetup -d /dev/urandom create crypt-swap /dev/sda6 Program received signal SIGSEGV, Segmentation fault. 0x000000000040737f in dm_query_device () (gdb) bt #0 0x000000000040737f in dm_query_device () #1 0x0000000000405312 in __crypt_create_device () #2 0x0000000000405ed8 in crypt_job () #3 0x0000000000400498 in action_create () #4 0x0000000000400e49 in main () Tested with USE-flag +/-dynamic and FEATURES set to nostrip debug I reemerged device-mapper and cryptsetup-luks. Same problem. Even downgrading device-mapper does not change anything. If using the dynamic use flag, the error output of cryptsetup-luks changes from a seg-fault to: Command failed: Invalid argument So you can see, I really don´t like to use the -luks version at the present. ;-) Maybe this bug is amd64 related, don´t know
Fixed the bug! Both versions of cryptsetup need the above patch! While libdevmapper.c is at "src" in cryptsetup, it is at "lib" in -luks. Thanks anyways Christian
Created attachment 78634 [details] cryptsetup/cryptsetup-0.1-r2.ebuild
Created attachment 78635 [details] device-mapper.diff for cryptsetup
Created attachment 78636 [details] cryptsetup-luks/cryptsetup-luks-1.0.1-r1.ebuild
Created attachment 78637 [details] device-mapper.diff for cryptsetup-luks
Uhm, fixing the issue for yourself isn't particularly useful for others. Reopening.
I just got around to doing the cryptsetup one and through this one into cvs as well. Thanks for reporting.