[rhinstaller/anaconda/pulls/127 master] Test that LVM device is encrypted.

dwlehman installerbot-noreply at redhat.com
Wed Jun 3 18:43:49 UTC 2015


> @@ -0,0 +1,31 @@
> +url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/$releasever/$basearch/os/"
> +install
> +network --bootproto=dhcp
> +
> +bootloader --timeout=1
> +zerombr
> +clearpart --all --initlabel
> +part pv.68 --asprimary --fstype="lvmpv" --ondisk=sda --size=7691
> +part /boot --asprimary --fstype="ext4" --ondisk=sda --size=500
> +volgroup vg01 --pesize=4096 pv.68
> +logvol /  --fstype="ext4" --size=5000 --encrypted --name=root_lv --vgname=vg01 --passphrase=OntarioIsAProvince --label=root
> +logvol /var  --fstype="ext4" --size=1000 --name=var_lv --vgname=vg01
> +logvol swap  --fstype="swap" --size=1024 --name=swap_lv --vgname=vg01
> +logvol /home  --fstype="ext4" --grow --size=1 --name=home_lv --vgname=vg01
> +
> +keyboard us
> +lang en_US.UTF-8
> +timezone America/New_York --utc
> +rootpw testcase
> +shutdown
> +
> +%packages --default
> +%end
> +
> +%post
> +if [ -z "$(blkid -t TYPE="crypto_LUKS")" ]; then

You could do something a bit more demanding along these lines:

```sh
by_path=$(blkid -odevice -t LABEL=root | grep -q '^/dev/mapper/luks-')
by_type=$(blkid -ovalue -t LABEL=root -sTYPE | grep crypto_LUKS)
if [ -z "$by_path" -a -z "$by_type" ]; then
    echo "root LV is not encrypted" > /root/RESULT
fi
```
  

-- 
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/127#discussion_r31655825


More information about the anaconda-patches mailing list