Bug#906664: initramfs-tools: Add partition table support to get_fstype
Package: initramfs-tools
Version: 0.131ubuntu8
Severity: wishlist
Hi,
I'd like to have fully encrypted system with partition table inside of LUKS container. It is easier to manage for me than multi-layer LVM.
However, there are 2 issues with this described here: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/1786688
The first issue is that after decryption of LUKS container there is a filesystem check and `get_fstype` function returns `undefined` for any partition table.
I'd like it to return `pttable` or something similar instead, so that after decryption it will not lock container back with "unknown fstype, bad password or options?".
Patch would look something like this:
get_fstype ()
{
local FS FSTYPE FSSIZE RET
FS="${1}"
# blkid has a more complete list of file systems,
# but fstype is more robust
FSTYPE="unknown"
eval $(fstype "${FS}" 2> /dev/null)
if [ "$FSTYPE" = "unknown" ]; then
FSTYPE=$(blkid -o value -s TYPE "${FS}")
fi
- RET=$?
+
+ if [ -z "${FSTYPE}" ]; then
+ if [ ! -z $(blkid -o value -s PTTABLE "${FS}") ]; then
+ FSTYPE="pttable"
+ fi
+ RET=$?
+ fi
+
+ RET=$?
if [ -z "${FSTYPE}" ]; then
FSTYPE="unknown"
fi
echo "${FSTYPE}"
return ${RET}
}
This would be the first step, after that it would be possible to adjust cryptsetup integration to scan decrypted partition table for partitions with partprobe or kpartx.
I don't know how to send patch properly, so redirect me to proper place if this is not the right one.
Reply to: