Merge pull request #26 from pullmoll/master

void-mklive: Fixes for systems with md / lvm2
This commit is contained in:
Juan RP 2015-05-08 07:11:19 +02:00
commit 18fda50245
2 changed files with 18 additions and 17 deletions

View File

@ -24,27 +24,27 @@ readonly CINNAMON_PKGS="$X_PKGS lxdm cinnamon colord gnome-terminal gvfs-afc gvf
[ ! -x mklive.sh ] && exit 0 [ ! -x mklive.sh ] && exit 0
if [ -z "$TARGET" -o $TARGET = base ]; then if [ -z "$TARGET" -o "$TARGET" = base ]; then
if [ ! -e $BASE_IMG ]; then if [ ! -e $BASE_IMG ]; then
./mklive.sh -o $BASE_IMG -p "$BASE_PKGS" $@ ./mklive.sh -o $BASE_IMG -p "$BASE_PKGS" $@
fi fi
fi fi
if [ -z "$TARGET" -o $TARGET = e ]; then if [ -z "$TARGET" -o "$TARGET" = e ]; then
if [ ! -e $E_IMG ]; then if [ ! -e $E_IMG ]; then
./mklive.sh -o $E_IMG -p "$E_PKGS" $@ ./mklive.sh -o $E_IMG -p "$E_PKGS" $@
fi fi
fi fi
if [ -z "$TARGET" -o $TARGET = xfce ]; then if [ -z "$TARGET" -o "$TARGET" = xfce ]; then
if [ ! -e $XFCE_IMG ]; then if [ ! -e $XFCE_IMG ]; then
./mklive.sh -o $XFCE_IMG -p "$XFCE_PKGS" $@ ./mklive.sh -o $XFCE_IMG -p "$XFCE_PKGS" $@
fi fi
fi fi
if [ -z "$TARGET" -o $TARGET = mate ]; then if [ -z "$TARGET" -o "$TARGET" = mate ]; then
if [ ! -e $MATE_IMG ]; then if [ ! -e $MATE_IMG ]; then
./mklive.sh -o $MATE_IMG -p "$MATE_PKGS" $@ ./mklive.sh -o $MATE_IMG -p "$MATE_PKGS" $@
fi fi
fi fi
if [ -z "$TARGET" -o $TARGET = cinnamon ]; then if [ -z "$TARGET" -o "$TARGET" = cinnamon ]; then
if [ ! -e $CINNAMON_IMG ]; then if [ ! -e $CINNAMON_IMG ]; then
./mklive.sh -o $CINNAMON_IMG -p "$CINNAMON_PKGS" $@ ./mklive.sh -o $CINNAMON_IMG -p "$CINNAMON_PKGS" $@
fi fi

View File

@ -163,24 +163,25 @@ show_partitions() {
echo "size:${fssize:-unknown};fstype:${fstype:-none}" echo "size:${fssize:-unknown};fstype:${fstype:-none}"
fi fi
done done
# Software raid (md) done
for p in $(ls -d /dev/md* 2>/dev/null|grep '[0-9]'); do # Software raid (md)
if cat /proc/mdstat|grep -qw $(echo $p|sed -e 's|/dev/||g'); then for p in $(ls -d /dev/md* 2>/dev/null|grep '[0-9]'); do
fstype=$(lsblk -nfr /dev/$part|awk '{print $2}') if cat /proc/mdstat|grep -qw $(echo $p|sed -e 's|/dev/||g'); then
fssize=$(lsblk -nr /dev/$p|awk '{print $4}') fstype=$(lsblk -nfr /dev/$p|awk '{print $2}')
echo "$p" [ "$fstype" = "crypto_LUKS" ] && continue
echo "size:${fssize:-unknown};fstype:${fstype:-none}" [ "$fstype" = "LVM2_member" ] && continue
fi fssize=$(lsblk -nr /dev/$p|awk '{print $4}')
done echo "$p"
if [ ! -e /sbin/lvs ]; then echo "size:${fssize:-unknown};fstype:${fstype:-none}"
continue
fi fi
done
if [ -e /sbin/lvs ]; then
# LVM # LVM
lvs --noheadings|while read lvname vgname perms size; do lvs --noheadings|while read lvname vgname perms size; do
echo "/dev/mapper/${vgname}-${lvname}" echo "/dev/mapper/${vgname}-${lvname}"
echo "size:${size};fstype:lvm" echo "size:${size};fstype:lvm"
done done
done fi
} }
menu_filesystems() { menu_filesystems() {