aboutsummaryrefslogtreecommitdiffstats
path: root/emulators/hyperv-is/pkg-install
blob: 528e23bdb3584e0f9ac6834e15027ae21ec70841 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
#
# make install or pkg_add script
# Checks labels/gptids for roots and swap partitions
# adds hyperv labels in loader.conf 
#

if [ "$2" = "PRE-INSTALL" ]; then
echo "===> Pre-install Check"

#rootfs check
root_flag=$(mount | awk '/ on \/ / { print $1 }' | cut -d / -f3-)
if [ "$root_flag" != "" ]; then
   fs_test=$(glabel status | awk '{print $1}' | grep $root_flag)
   if [ "$fs_test" == "" ]; then
      echo " xxx rootfs Label/gptid missing in fstab"  
   fi
else 
   echo " xxx rootfs Label/gptid missing in fstab"
fi
#swap check
[ -f /etc/fstab ] && swap_flag=$(grep swap /etc/fstab | awk '{print $1}' | cut -d / -f3-)
if [ "$swap_flag" != "" ]; then
   sw_test=$(glabel status | awk '{print $1}' | grep $swap_flag)
   if [ "$sw_test" == "" ]; then
      echo " xxx swap Label/gptid missing in fstab"  
   fi
else   
   echo " xxx swap Label/gptid missing in fstab "
fi

if [ "$fs_test" != "" -a  "$sw_test" != "" ]; then
   echo "===> Labels/gptids Found"
   echo "===> Hyper-V BIS Installation Continues"
else
   echo "===> Labels/gptids Not found"
   echo "===> Hyper-V BIS Installation Aborted"
   echo "===> Refer to Disk UUID section in README document"
   echo "===> Please refer the Prerequisites page and complete all steps" 
   echo "WWW: https://github.com/FreeBSDonHyper-V/Hyperv-Ports/wiki/Prerequisites " 
   exit 1 
fi
fi
exit 0