I solved the problem with extensiv dependencies and tested the swap behaviour
so I also didn't separate
the swap-detect method anymore. I hope there are no problems with my new patch
format (diff standard).
Description:
The scripts to generate a grub.cfg file doesn't find lvm under encrypted
partitions (arch). Also the hibernation support beyond luks and lvm is manual
work.
Debian has fixed this problem elsewise but it would be nice to have a clean
way detecting such partitions.
I attach a patch to do so with an alternative /etc/grub.d/10_linux file
(cryptswapgrub2.patch).
61a62,88
>
> cryptdetect ()
> {
> #check if luks
> if grub-probe -t abstraction -d ${LINUX_ROOT_DEVICE} | grep "luks" > /dev/null
> then
> #check if lvm
> lvmname=""
> if grub-probe -t abstraction -d ${LINUX_ROOT_DEVICE} | grep "lvm" > /dev/null; then
> lvmname=":$(dmsetup --noheadings info -c -o vg_name ${LINUX_ROOT_DEVICE})"
> fi
> #format then insert
> cryptdevice_check=$(grub-probe -t cryptodisk_uuid -d ${LINUX_ROOT_DEVICE} | fold -w 4)
> cryptdevice_tmp="cryptdevice=/dev/disk/by-uuid/$(echo ${cryptdevice_check} | sed -e "s/ //" -e "s/ /-/" -e "s/ /-/" -e "s/ /-/" -e "s/ /-/" -e "s/ //" -e "s/ //")${lvmname}"
> fi
> }
>
> swapresumedetect()
> {
> swapdev=""
> local swapdev_tmp=$(grep "swap" /etc/fstab | sed -e "s/ [^ ]\+//g" -e "s/ //g";)
> if [ swapdev_tmp ]
> then
> swapdev="resume=$(echo $swapdev_tmp | sed "s/ / resume=/g")"
> fi
> }
>
67a95,96
> cryptdetect
> swapresumedetect
121c150
< linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
---
> linux ${rel_dirname}/${basename} ${cryptdevice_tmp} ${swapdev} root=${linux_root_device_thisversion} ro ${args}
_______________________________________________
Bug-grub mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-grub