Bug#535801: cryptsetup: root-device is changed wrongly

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#535801: cryptsetup: root-device is changed wrongly

Johann Felix Soden
Package: cryptsetup
Version: 2:1.0.7~rc1-1
Severity: important

I have the following config:
  target=sda1Crypt,source=/dev/sda1,key=none

target=sda2Crypt,source=/dev/sda2,key=sda1Crypt,keyscript=/lib/cryptsetup/scripts/decrypt_derived

sda1Crypt is root filesystem, sda2Crypt is my swap partition.

In the new version 2:1.0.7~rc1-1 the root device is changed to
/dev/mapper/sda2Crypt, so the system can't mount its root partition and
fails to boot.

I think the recent fix for lilo (I use grub):
  echo "ROOT=$NEWROOT" >> /conf/param.conf
in scripts/local-top/cryptroot is responsible for this behavior.


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.30 (SMP w/2 CPU cores; PREEMPT)

Versions of packages cryptsetup depends on:
ii  dmsetup                      2:1.02.30-3 The Linux Kernel Device
Mapper use
ii  libc6                        2.9-18      GNU C Library: Shared
libraries
ii  libdevmapper1.02.1           2:1.02.30-3 The Linux Kernel Device
Mapper use
ii  libpopt0                     1.14-4      lib for parsing cmdline
parameters
ii  libuuid1                     1.41.7-1    Universally Unique ID
library

cryptsetup recommends no packages.

Versions of packages cryptsetup suggests:
ii  dosfstools                    3.0.3-1    utilities for making and
checking
ii  initramfs-tools [linux-initra 0.93.3     tools for generating an
initramfs
ii  udev                          0.141-1    /dev/ and hotplug
management daemo

-- no debconf information





--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#535801: [pkg-cryptsetup-devel] Bug#535801: cryptsetup: root-device is changed wrongly

Jonas Meurer
Hello,

On 05/07/2009 [hidden email] wrote:

> I have the following config:
>   target=sda1Crypt,source=/dev/sda1,key=none
>
> target=sda2Crypt,source=/dev/sda2,key=sda1Crypt,keyscript=/lib/cryptsetup/scripts/decrypt_derived
>
> sda1Crypt is root filesystem, sda2Crypt is my swap partition.
>
> In the new version 2:1.0.7~rc1-1 the root device is changed to
> /dev/mapper/sda2Crypt, so the system can't mount its root partition and
> fails to boot.
>
> I think the recent fix for lilo (I use grub):
>   echo "ROOT=$NEWROOT" >> /conf/param.conf
> in scripts/local-top/cryptroot is responsible for this behavior.

I'm unable to reproduce the issue on a system with hdb1 as cryptroot and
hda2 as encrypted swap, using the decrypt_derived keyscript just like
you.

please re-generate your initramfs with
sh -x mkinitramfs -o /tmp/initramfs-$(uname -r) 2> /tmp/log

and send /tmp/log to the bugreport.

thanks,
 jonas



--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#535801: [pkg-cryptsetup-devel] Bug#535801: cryptsetup: root-device is changed wrongly

Jonas Meurer
In reply to this post by Johann Felix Soden
Hey,

On 05/07/2009 [hidden email] wrote:
> sda1Crypt is root filesystem, sda2Crypt is my swap partition.
>
> In the new version 2:1.0.7~rc1-1 the root device is changed to
> /dev/mapper/sda2Crypt, so the system can't mount its root partition and
> fails to boot.
>
> I think the recent fix for lilo (I use grub):
>   echo "ROOT=$NEWROOT" >> /conf/param.conf
> in scripts/local-top/cryptroot is responsible for this behavior.

you're correct, "ROOT=$NEWROOT" is added to /conf/param.conf for every
device from /conf/conf.d/cryptroot. that means that it even happens for
resume devices.

i prepared a package which hopefully fixes this issue. it adds a flag
'rootdev' to /conf/conf.d/cryptroot for the real root device at
initramfs creation time. in the initramfs, cryptroot script checks for
that 'rootdev' flag before adding "ROOT=$NEWROOT" to /conf/param.conf.

that way the new introduced bug should be fixed while the lilo bug
remains fixed as well.

could you give the new package a try before I actually upload it to
debian/unstable? (everyone who commented on the bugreport is Cc'ed)

you can find the package (i386 and amd64) at:
http://people.debian.org/~mejo/cryptsetup/

greetings,
 jonas

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#535801: cryptsetup: root-device is changed wrongly

Evgeni Golov
Hi,

On Mon, Jul 13, 2009 at 12:48:14AM +0200, Jonas Meurer wrote:
> i prepared a package which hopefully fixes this issue. it adds a flag
> 'rootdev' to /conf/conf.d/cryptroot for the real root device at
> initramfs creation time. in the initramfs, cryptroot script checks for
> that 'rootdev' flag before adding "ROOT=$NEWROOT" to /conf/param.conf.
>
> that way the new introduced bug should be fixed while the lilo bug
> remains fixed as well.

Yupp, that new version fixes it for me on i386 with GRUB2. No idea about
LILO though :)

Thanks for your work!

Regards
Evgeni



--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]