[CentOS] kickstart %pre vda/sda troubles

Sun Mar 10 15:14:30 UTC 2013
Natxo Asenjo <natxo.asenjo at gmail.com>

lets reply to myself then ;-)

%pre
#!/bin/bash

if [ -b /dev/vda ] ; then
    echo "bootloader --location=mbr --timeout=0 --driveorder=vda
--append="crashkernel=auto rhgb quiet"" > /tmp/diskinfo
    echo "clearpart --linux --drives=vda" >> /tmp/diskinfo
    echo "part /boot --fstype=ext4 --size=500" >> /tmp/diskinfo
    echo "part pv.008002 --grow --size=1" >> /tmp/diskinfo
    echo "volgroup vg_host --pesize=4096 pv.008002" >> /tmp/diskinfo
    echo "logvol / --fstype=ext4 --name=lv_root --vgname=vg_host
--grow --size=1024" --recommended >> /tmp/diskinfo
    echo "logvol swap --name=lv_swap --vgname=vg_host --grow
--size=512 --maxsize=1024" >> /tmp/diskinfo

elif [ -b /dev/sda ] ; then
    echo "bootloader --location=mbr --timeout=0 --driveorder=sda
--append="crashkernel=auto rhgb quiet"" > /tmp/diskinfo
    echo "clearpart --linux --drives=sda" >> /tmp/diskinfo
    echo "part /boot --fstype=ext4 --size=500" >> /tmp/diskinfo
    echo "part pv.008002 --grow --size=1" >> /tmp/diskinfo
    echo "volgroup vg_host --pesize=4096 pv.008002" >> /tmp/diskinfo
    echo "logvol / --fstype=ext4 --name=lv_root --vgname=vg_host
--grow --size=1024" --recommended >> /tmp/diskinfo
    echo "logvol swap --name=lv_swap --vgname=vg_host --grow
--size=512 --maxsize=1024" >> /tmp/diskinfo
fi

%end

as seen in http://fedoraproject.org/wiki/Anaconda/Kickstart#Chapter_4._Pre-installation_Script