#!/bin/bash #* Copyright (c) 2020 Intel Corporation All rights reserved. # postinst script for acrn-hypervisor set -e echo "please choose , ," echo "Scenario is -> 1. industry 2. hybrid 3. logical_partition" read num if [[ $num -eq 1 ]] then echo "Scenario is industry" SCENARIO="industry" elif [[ $num -eq 2 ]] then echo "Scenario is hybrid" SCENARIO="hybrid" elif [[ $num -eq 3 ]] then echo "Scenario is logical_partition" SCENARIO="logical_partition" fi echo "Board is -> 1. nuc7i7dnb 2. whl-ipc-i5" read num2 if [[ $num2 -eq 1 ]] then echo "Board is nuc7i7dnb" BOARD="nuc7i7dnb" elif [[ $num2 -eq 2 ]] then echo "Board is whl-ipc-i5" BOARD="whl-ipc-i5" fi ACRNBIN="/boot/acrn.${SCENARIO}.${BOARD}.bin" echo "Your acrn bin is ->" echo $ACRNBIN echo "disk type is -> 1. nvme 2. sda" read num3 if [[ $num3 -eq 1 ]] then echo "disk type is nvme" type="nvme" elif [[ $num3 -eq 2 ]] then echo "disk type is sda" type="sda" fi str=$(blkid |grep ext4 |grep ${type}) uuid=$(echo $str |cut -d " " -f 2|cut -d "=" -f 2) str=$(blkid |grep ext4 |grep ${type}) partuuid=$(echo ${str##*PARTUUID=}) filename="/etc/grub.d/40_custom" kernelimg=$(grep module ${filename}|| true) kernelimg2='/boot/' if [ "$kernelimg" ] then kernelimg2=$(echo $kernelimg |cut -d ' ' -f 2) fi cat>"${filename}"<