#!/bin/bash

. /usr/share/preupgrade/common.sh
#END GENERATED SECTION

export LVM_SUPPRESS_FD_WARNINGS=1
cp /proc/partitions $KICKSTART_DIR/
cp /etc/fstab $KICKSTART_DIR/
lsblk -r --noheadings > $KICKSTART_DIR/lsblk_list
pvs --noheadings --separator ':' > $KICKSTART_DIR/pvs_list
vgs --noheadings --separator ':' > $KICKSTART_DIR/vgs_list
lvdisplay -C --noheadings --separator ':' > $KICKSTART_DIR/lvdisplay

echo " * partitions - a copy of the /proc/partitions system file, it can be used in Kickstart for a disk layout" >>"$KICKSTART_README"
echo " * fstab - a copy of automated system mountpoints from the /etc/fstab file" >>"$KICKSTART_README"
echo " * lsblk_list - a list of block devices generated by the 'lsblk --list' command" >>"$KICKSTART_README"
echo " * pvs_list - a list of physical volumes generated by the 'pvs' command " >>"$KICKSTART_README"
echo " * vgs_list - a list of volume groups generated by the 'vgs' command " >>"$KICKSTART_README"

grep "[[:space:]]ext4[[:space:]]" /etc/fstab >/dev/null && exit $RESULT_INFORMATIONAL

exit $RESULT_PASS
