Bug#488687: partman-crypto: Broken when using multiple disks - Debian
This is a discussion on Bug#488687: partman-crypto: Broken when using multiple disks - Debian ; tag 488687 + patch
reassign 488687 partman-base
thanks
On Mon, Jun 30, 2008 at 06:32:30PM +0200, Daniel Baumann wrote:
> I can reproduce it on a couple of completely different machines with
> always the same result. However, the last ...
-
Bug#488687: partman-crypto: Broken when using multiple disks
tag 488687 + patch
reassign 488687 partman-base
thanks
On Mon, Jun 30, 2008 at 06:32:30PM +0200, Daniel Baumann wrote:
> I can reproduce it on a couple of completely different machines with
> always the same result. However, the last one I did had the following
> partitioning layout:
>
> /dev/hda1 /boot ext3
> /dev/hda5 crypted random key
> /dev/hda6 crypted passphrase
> /dev/hda7 crypted passphrase
>
> /dev/hdb1 crypted passphrase
>
> as soon as you press the 'Configure encrypted volumes', d-i starts
> creating the *first* and the *last* encrypted partitions, im my case
> these are hda5_crypt and hdb1_crypt. those in between are skipped.
> Running a 'Configure encrypted volumes' again, doesn't help much as it
> messes arround again with the previous configured partitions and wants
> to reformat them again and again.
The problem lies in the fact that:
* crypto_setup() changes the current directory to the partman
directory for the device on which is located the encrypted
partition,
* crypto_setup() calls setup_cryptdev(),
* setup_cryptdev() calls partman_lock_unit(),
* partman_lock_unit() goes through all devices (and partitions),
changing the current directory.
The attached patch changes partman_lock_unit() and partman_unlock_unit()
to restore the current directory once their job is done. I am not
commiting this patch directly as I doubt it to be the best way to do
this.
One could argue that a pair of parenthesis could be put around the call
to partman_lock_unit() in setup_cryptdev(); please reassign the bug back
to partman-crypto if that feels more desirable.
Cheers,
--
Jérémy Bobbio .''`.
lunar@debian.org : :Ⓐ : # apt-get install anarchism
`. `'`
`-
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIb7zv2PUjs9fQ72URAnakAJ4rCJ1VZlBcolE56zCqVL fltRN+3ACfQcX4
S9d+BdkkCu1n6vbBRfQdDtY=
=n1QS
-----END PGP SIGNATURE-----
-
Bug#488687: partman-crypto: Broken when using multiple disks
On Saturday 05 July 2008, =?UTF-8?Q?J=C3=A9r=C3=A9my?= Bobbio wrote:
> The attached patch changes partman_lock_unit() and
> partman_unlock_unit() to restore the current directory once their job
> is done. I am not commiting this patch directly as I doubt it to be
> the best way to do this.
Looks fairly clean and as I would not expect these functions to become
much more complicated I think it's OK.
> One could argue that a pair of parenthesis could be put around the call
> to partman_lock_unit() in setup_cryptdev(); please reassign the bug
> back to partman-crypto if that feels more desirable.
Instead of relying on all callers to do that, I'd prefer to see the
functions themselves start a subshell. That would be a good alternative
to saving cwd.
I'm not sure if a subshell is really to be preferred over the saving cwd
or not.
--
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org