May I suggest a change to /etc/init.d/boot.crypto ?
First the "real life context":
I prepare my /etc/crypttab and my /etc/fstab for quite a few different external encrypted disks.
And I don't attach them all at the same time, esp. not at boot time.
/etc/init.d/boot.crypto shouldn't bother attempting to mount disks,
that are not currently attached.
Now for internals of the script:
The test "cryptsetup isLuks ..." should be preceded
by a test on the existence of the "device",
i.e. the symlink in /dev/disk/by-id/ .
So far, if "cryptsetup isLuks ..." returns false,
"this is used for things like swap or other temp mappings",
as the comment in the "else" branch says.
So because that's used already for something meaningful,
there should just be another test beforehand.
And this is my suggested code:
if ! test -L "$device"; then
echo -e "device {$device} does not exist currently.\n"
ret=1
continue
elif cryptsetup isLuks "$device" &> /dev/null; then
----------
Actually there is also something else, I would like to suggest.
I really prefer names like "scsi-SATA_FUJITSU_MHT2080_NN5AT43149CP-part4" over names like "sdb4" in /etc/fstab and also in /etc/crypttab .
You guess why, don't you?
We don't know in advance, in which order we attach / detach / re-attach ... external disks during the weeks and months.
And "sdb4" assumes (somehow), that the disk is the 2nd SCSI disk.
But maybe "today" we only attach it as the 3rd.
And for the same reason names like "sdb4" should also not be used to create names in /dev/mapper/ .
The entries with names like "sdb4" in /etc/fstab and in /etc/crypttab get created by yast's "System / Partitioner".
It's not really a major effort for me, renaming "sdb4" to something more flexible,
everytime we attach yet another external encrypted disk,
but I guess I am not the only one doing so.
So a few others around this globe might enjoy such an improvement, too.
----------
I would really enjoy seeing the suggested changes in 10.4 or so ... :-)
Kind regards,
J.
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-factory+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-factory+help(a)opensuse.org