2019-03-15 16:48:54 +08:00
|
|
|
#!/bin/bash
|
2019-03-20 18:01:07 +08:00
|
|
|
# Copyright (C) 2019 Intel Corporation.
|
2019-03-15 16:48:54 +08:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2019-03-20 18:21:54 +08:00
|
|
|
#
|
2019-10-25 19:42:27 +08:00
|
|
|
# This script provides a quick and automatic setup of the Service VM or User VM.
|
2019-11-07 08:56:43 +08:00
|
|
|
# Run this script with root privilege since it will modify various system parameters.
|
2019-03-21 19:08:26 +08:00
|
|
|
#
|
2019-03-20 18:21:54 +08:00
|
|
|
# Usages:
|
2019-11-07 08:56:43 +08:00
|
|
|
# Upgrade Service VM to 31080 without reboot; this is highly recommended so that you can check configurations after the upgrade Service VM.
|
2019-10-18 16:34:59 +08:00
|
|
|
# sudo <script> -s 31080 -d
|
2019-11-07 08:56:43 +08:00
|
|
|
# Upgrade Service VM to 31080 with the specified proxy server
|
2019-10-18 16:34:59 +08:00
|
|
|
# sudo <script> -s 31080 -p <your proxy server>:<port>
|
2019-11-07 08:56:43 +08:00
|
|
|
# Upgrade User VM to 31080 with the specified proxy server
|
2019-10-18 16:34:59 +08:00
|
|
|
# sudo <script> -u 31080 -p <your proxy server>:<port>
|
2019-11-07 08:56:43 +08:00
|
|
|
# Upgrade User VM to 31080 without downloading the User VM image; you should put the User VM image in the /root directory previously.
|
2019-10-18 16:34:59 +08:00
|
|
|
# sudo <script> -u 31080 -k
|
2019-03-15 16:48:54 +08:00
|
|
|
|
|
|
|
function print_help()
|
|
|
|
{
|
2019-03-21 19:08:26 +08:00
|
|
|
echo "Usage:"
|
2019-10-28 14:23:23 +08:00
|
|
|
echo "Launch this script as: sudo $0 -s 31470"
|
2019-11-07 08:56:43 +08:00
|
|
|
echo -e "\t-s to upgrade the Service VM"
|
|
|
|
echo -e "\t-u to upgrade the User VM"
|
2019-04-09 10:24:47 +08:00
|
|
|
echo -e "\t-p to specify a proxy server (HTTPS)"
|
2019-11-07 08:56:43 +08:00
|
|
|
echo -e "\t-m to use the swupd mirror url"
|
|
|
|
echo -e "\t-k to skip downloading the User VM; if enabled, you must download the User VM image before you upgrade. Default is off"
|
|
|
|
echo -e "\t-d to disable the reboot device so that you can check configurations after you upgrade the Service VM"
|
|
|
|
echo -e "\t-i to set up the Service VM with the industry scenario"
|
|
|
|
echo -e "\t-e to specify the EFI System Partition (ESP); default: /dev/sda1"
|
2019-04-09 10:24:47 +08:00
|
|
|
echo -e "\n\t<Note>:"
|
2019-11-07 08:56:43 +08:00
|
|
|
echo -e "\tThis script is using /dev/sda1 as the default EFI System Partition (ESP)."
|
|
|
|
echo -e "\tThe ESP may be different based on your hardware; in this case, specify it directly with the '-e' option."
|
|
|
|
echo -e "\tThis will typically be something like /dev/mmcblk0p1 on platforms that have an on-board eMMC"
|
2019-04-09 10:24:47 +08:00
|
|
|
echo -e "\tOr /dev/nvme0n1p1 if your system has a non-volatile storage media attached via a PCI Express (PCIe) bus (NVMe)."
|
2019-03-21 19:08:26 +08:00
|
|
|
exit 1
|
2019-03-15 16:48:54 +08:00
|
|
|
}
|
|
|
|
|
2019-11-07 08:56:43 +08:00
|
|
|
# get the previous Clear Linux version
|
2019-03-21 19:08:26 +08:00
|
|
|
source /etc/os-release
|
2019-11-07 08:56:43 +08:00
|
|
|
# switcher for downloading the User VM function
|
2019-03-20 18:21:54 +08:00
|
|
|
skip_download_uos=0
|
2019-11-07 08:56:43 +08:00
|
|
|
# switcher for disabling the reboot device
|
2019-03-21 19:08:26 +08:00
|
|
|
disable_reboot=0
|
2019-11-08 18:55:03 +08:00
|
|
|
# set default scenario name
|
|
|
|
scenario=sdc
|
2020-04-03 14:52:34 +08:00
|
|
|
# swupd config file path
|
|
|
|
swupd_config=/usr/share/defaults/swupd/config
|
2019-03-20 18:21:54 +08:00
|
|
|
|
2019-03-15 16:48:54 +08:00
|
|
|
function upgrade_sos()
|
|
|
|
{
|
2019-10-25 19:42:27 +08:00
|
|
|
# Check Service VM version
|
2019-11-07 08:56:43 +08:00
|
|
|
[[ `echo $sos_ver | awk '{print length($0)}'` -ne 5 ]] && echo "Input the correct Service VM version to which to upgrade" && exit 1
|
|
|
|
[[ $VERSION_ID -gt $sos_ver ]] && echo "You are attempting to install an older version of Clear Linux." && exit 1
|
2019-03-21 19:08:26 +08:00
|
|
|
|
2019-10-25 19:42:27 +08:00
|
|
|
echo "Upgrading Service VM..."
|
2019-03-21 19:08:26 +08:00
|
|
|
|
2019-10-28 14:23:23 +08:00
|
|
|
# get board name
|
2019-11-08 18:55:03 +08:00
|
|
|
BOARD_NAME=`cat /sys/devices/virtual/dmi/id/board_name | cut -d' ' -f1`
|
2019-10-28 14:23:23 +08:00
|
|
|
BOARD_NAME=${BOARD_NAME,,}
|
|
|
|
[[ -z $BOARD_NAME ]] && echo "Unknown board name." && exit 1
|
|
|
|
echo "Board name is: $BOARD_NAME"
|
2019-11-08 18:55:03 +08:00
|
|
|
|
2019-11-07 08:56:43 +08:00
|
|
|
# set up mirror and proxy url while specified with m and p options
|
2020-03-31 15:09:40 +08:00
|
|
|
[[ -n $mirror ]] && echo "Setting swupd mirror to: $mirror" && \
|
2020-04-03 14:52:34 +08:00
|
|
|
sed -i 's/#allow_insecure_http=<true\/false>/allow_insecure_http=true/' $swupd_config && \
|
2020-03-31 15:09:40 +08:00
|
|
|
swupd mirror -s $mirror
|
2019-03-21 19:08:26 +08:00
|
|
|
[[ -n $proxy ]] && echo "Setting proxy to: $proxy" && export https_proxy=$proxy
|
|
|
|
|
2019-11-07 08:56:43 +08:00
|
|
|
# Check that the EFI path exists.
|
|
|
|
[[ ! -b $efi_partition ]] && echo "Set the right EFI System partition first." && exit 1
|
2019-03-21 19:08:26 +08:00
|
|
|
partition=`echo $efi_partition | sed 's/1$//g;s/p$//g'`
|
|
|
|
|
|
|
|
echo "Disable auto update..."
|
|
|
|
swupd autoupdate --disable 2>/dev/null
|
|
|
|
|
2019-11-07 08:56:43 +08:00
|
|
|
# Compare with the current Clear linux and skip the upgrade Service VM if you get the same version.
|
2019-03-21 19:08:26 +08:00
|
|
|
if [[ $VERSION_ID -eq $sos_ver ]]; then
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Clear Linux version $sos_ver is already installed. Continuing to set up the Service VM..."
|
2019-03-21 19:08:26 +08:00
|
|
|
else
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Upgrading the Clear Linux version from $VERSION_ID to $sos_ver ..."
|
2020-04-03 14:52:34 +08:00
|
|
|
swupd repair -x --picky -V $sos_ver 2>/dev/null
|
2019-03-15 16:48:54 +08:00
|
|
|
fi
|
|
|
|
|
2019-03-21 19:08:26 +08:00
|
|
|
# Do the setups if previous process succeed.
|
|
|
|
if [[ $? -eq 0 ]]; then
|
2020-04-03 14:52:34 +08:00
|
|
|
[[ -n $mirror ]] && sed -i 's/#allow_insecure_http=<true\/false>/allow_insecure_http=true/' $swupd_config
|
2019-09-18 16:06:16 +08:00
|
|
|
echo "Adding the service-os and systemd-networkd-autostart bundles..."
|
|
|
|
swupd bundle-add service-os systemd-networkd-autostart 2>/dev/null
|
2019-03-21 19:08:26 +08:00
|
|
|
|
2019-10-28 14:23:23 +08:00
|
|
|
# get acrn.efi path
|
|
|
|
acrn_efi_path=/usr/lib/acrn/acrn.$BOARD_NAME.$scenario.efi
|
2020-03-31 15:09:40 +08:00
|
|
|
if [[ $BOARD_NAME == "wl10" ]] && [[ ! -f $acrn_efi_path ]]; then
|
|
|
|
echo "$acrn_efi_path does not exist."
|
|
|
|
echo "Using /usr/lib/acrn/acrn.nuc7i7dnb.industry.efi instead."
|
|
|
|
set -x
|
|
|
|
cp -r /usr/lib/acrn/acrn.nuc7i7dnb.industry.efi $acrn_efi_path
|
|
|
|
{ set +x; } 2>/dev/null
|
|
|
|
fi
|
2019-10-28 14:23:23 +08:00
|
|
|
if [[ ! -f $acrn_efi_path ]]; then
|
|
|
|
echo "$acrn_efi_path doesn't exist."
|
|
|
|
echo "Use one of these efi images from /usr/lib/acrn."
|
|
|
|
echo "------"
|
|
|
|
ls /usr/lib/acrn/acrn.*.$scenario.efi -1
|
|
|
|
echo "------"
|
|
|
|
echo "Copy the efi image to $acrn_efi_path, then run the script again."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-03-21 19:08:26 +08:00
|
|
|
mount $efi_partition /mnt
|
|
|
|
echo "Add /mnt/EFI/acrn folder"
|
|
|
|
mkdir -p /mnt/EFI/acrn
|
2019-09-26 14:51:59 +08:00
|
|
|
echo "Copy $acrn_efi_path to /mnt/EFI/acrn/acrn.efi"
|
2019-03-21 19:08:26 +08:00
|
|
|
if [[ ! -f $acrn_efi_path ]]; then
|
2019-09-26 14:51:59 +08:00
|
|
|
echo "Missing $acrn_efi_path file"
|
2019-03-21 19:08:26 +08:00
|
|
|
umount /mnt && sync
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-11-08 18:55:03 +08:00
|
|
|
cp -r $acrn_efi_path /mnt/EFI/acrn/acrn.efi
|
2019-11-07 08:56:43 +08:00
|
|
|
if [[ $? -ne 0 ]]; then echo "Failed to copy $acrn_efi_path" && exit 1; fi
|
2019-10-25 19:42:27 +08:00
|
|
|
|
2019-10-28 14:23:23 +08:00
|
|
|
new_kernel=`ls /usr/lib/kernel/org*sos* -tl | head -n1 | awk -F'/' '{print $5}'`
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Getting the latest Service OS kernel version: $new_kernel"
|
2019-10-25 19:42:27 +08:00
|
|
|
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Add the default (5 seconds) boot wait time."
|
|
|
|
clr-boot-manager set-timeout 5 || { echo "Failed to add the default boot wait time" && exit 1; }
|
2019-10-25 19:42:27 +08:00
|
|
|
clr-boot-manager update
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Set $new_kernel as the default boot kernel."
|
|
|
|
clr-boot-manager set-kernel $new_kernel || { echo "Failed to set $new_kernel as the default boot kernel." && exit 1; }
|
2019-10-25 19:42:27 +08:00
|
|
|
|
2019-10-28 14:23:23 +08:00
|
|
|
# Rename Clear-linux-iot-lts2018-sos conf to acrn.conf
|
|
|
|
conf_directory=/mnt/loader/entries/
|
2020-04-03 14:52:34 +08:00
|
|
|
conf=`sed -n 2p /mnt/loader/loader.conf | sed "s/default //" | sed "s/.conf$//"`
|
2019-10-28 14:23:23 +08:00
|
|
|
cp -r ${conf_directory}${conf}.conf ${conf_directory}acrn.conf 2>/dev/null || \
|
|
|
|
{ echo "${conf_directory}${conf}.conf does not exist." && exit 1; }
|
|
|
|
sed -i 2"s/$conf/acrn/" /mnt/loader/loader.conf
|
|
|
|
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Check the ACRN efi boot event"
|
2019-10-25 19:42:27 +08:00
|
|
|
check_acrn_bootefi=`efibootmgr | grep ACRN | wc -l`
|
|
|
|
if [[ "$check_acrn_bootefi" -ge 1 ]]; then
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Clean all ACRN efi boot events"
|
2019-03-21 19:08:26 +08:00
|
|
|
efibootmgr | grep ACRN | cut -d'*' -f1 | cut -d't' -f2 | xargs -i efibootmgr -b {} -B >/dev/null
|
|
|
|
fi
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Check the Linux bootloader event"
|
2019-03-21 19:08:26 +08:00
|
|
|
number=$(expr `efibootmgr | grep 'Linux bootloader' | wc -l` - 1)
|
|
|
|
if [[ $number -ge 1 ]]; then
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Clean all Linux bootloader events"
|
2019-03-21 19:08:26 +08:00
|
|
|
efibootmgr | grep 'Linux bootloader' | cut -d'*' -f1 | cut -d't' -f2 | head -n$number | xargs -i efibootmgr -b {} -B >/dev/null
|
|
|
|
fi
|
|
|
|
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Add new ACRN efi boot events; uart is disabled by default."
|
2019-10-28 14:23:23 +08:00
|
|
|
set -x
|
2020-03-31 15:09:40 +08:00
|
|
|
efibootmgr -c -l "\EFI\acrn\acrn.efi" -d $partition -p 1 -L "ACRN" -u "uart=disabled " >/dev/null
|
2019-10-28 14:23:23 +08:00
|
|
|
{ set +x; } 2>/dev/null
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Service OS setup is complete!"
|
2019-03-15 16:48:54 +08:00
|
|
|
else
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Failed to upgrade the Service VM to $sos_ver."
|
|
|
|
echo "Upgrade the Service VM with this command:"
|
2019-09-18 16:06:16 +08:00
|
|
|
echo "swupd update -V $sos_ver"
|
2019-03-21 19:08:26 +08:00
|
|
|
exit 1
|
2019-03-15 16:48:54 +08:00
|
|
|
fi
|
|
|
|
|
2019-03-21 19:08:26 +08:00
|
|
|
umount /mnt
|
|
|
|
sync
|
2019-11-07 08:56:43 +08:00
|
|
|
[[ $disable_reboot == 0 ]] && echo "Rebooting the Service OS to take effect." && reboot -f
|
2019-03-15 16:48:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function upgrade_uos()
|
|
|
|
{
|
2019-10-25 19:42:27 +08:00
|
|
|
# Check User VM version
|
2019-11-07 08:56:43 +08:00
|
|
|
[[ `echo $uos_ver | awk '{print length($0)}'` -ne 5 ]] && echo "Input the correct User VM version to which to upgrade" && exit 1
|
2019-03-20 18:21:54 +08:00
|
|
|
|
2019-10-25 19:42:27 +08:00
|
|
|
echo "Upgrading User VM..."
|
2019-03-15 16:48:54 +08:00
|
|
|
|
2019-10-25 19:42:27 +08:00
|
|
|
# User VM download link
|
2019-03-21 19:08:26 +08:00
|
|
|
uos_image_link="https://download.clearlinux.org/releases/$uos_ver/clear/clear-$uos_ver-kvm.img.xz"
|
2019-03-20 18:21:54 +08:00
|
|
|
|
2019-03-21 19:08:26 +08:00
|
|
|
# Set proxy if needed.
|
2019-11-07 08:56:43 +08:00
|
|
|
[[ -n $proxy ]] && echo "Setting the proxy to: $proxy" && export https_proxy=$proxy
|
2019-03-21 19:08:26 +08:00
|
|
|
# Corrupt script if /mnt is already mounted.
|
|
|
|
if [[ ! -z `findmnt /mnt -n` ]]; then
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "/mnt is already mounted; unmount it if you want to continue upgrading the User VM."
|
2019-03-21 19:08:26 +08:00
|
|
|
exit 1
|
2019-03-15 16:48:54 +08:00
|
|
|
fi
|
2019-03-21 19:08:26 +08:00
|
|
|
|
2019-10-25 19:42:27 +08:00
|
|
|
# Do upgrade User VM process.
|
2019-04-25 16:24:05 +08:00
|
|
|
if [[ $skip_download_uos != 1 ]]; then
|
2019-03-21 19:08:26 +08:00
|
|
|
cd ~
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Downloading the User VM image: $uos_image_link"
|
2019-04-25 16:24:05 +08:00
|
|
|
curl $uos_image_link -o clear-$uos_ver-kvm.img.xz
|
|
|
|
if [[ $? -ne 0 ]]; then
|
2019-10-25 19:42:27 +08:00
|
|
|
echo "Download User VM failed."
|
2019-04-25 16:24:05 +08:00
|
|
|
rm clear-$uos_ver-kvm.img.xz
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
uos_img_xz=$(find ~/ -name clear-$uos_ver-kvm.img.xz)
|
|
|
|
uos_img=$(find ~/ -name clear-$uos_ver-kvm.img)
|
|
|
|
if [[ -f $uos_img ]] && [[ -f $uos_img.xz ]]; then echo "Moving $uos_img to $uos_img.old."; mv $uos_img $uos_img.old; fi
|
|
|
|
if [[ ! -f $uos_img_xz ]] && [[ ! -f $uos_img ]]; then
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Download the User VM clear-$uos_ver-kvm.img.xz file first." && exit 1
|
2019-04-25 16:24:05 +08:00
|
|
|
fi
|
|
|
|
if [[ -f $uos_img_xz ]]; then
|
2019-10-25 19:42:27 +08:00
|
|
|
echo "Unxz User VM file: $uos_img_xz"
|
2019-04-25 16:24:05 +08:00
|
|
|
unxz $uos_img_xz
|
|
|
|
uos_img=`echo $uos_img_xz | sed 's/.xz$//g'`
|
2019-03-15 16:48:54 +08:00
|
|
|
fi
|
2019-03-21 19:08:26 +08:00
|
|
|
|
2019-11-07 08:56:43 +08:00
|
|
|
echo "Get the User VM image: $uos_img"
|
2019-09-18 16:06:16 +08:00
|
|
|
uos_loop_device=`losetup -f -P --show $uos_img`
|
|
|
|
|
2019-11-07 08:56:43 +08:00
|
|
|
mount ${uos_loop_device}p3 /mnt || { echo "Failed to mount the User VM rootfs partition" && exit 1; }
|
|
|
|
mount ${uos_loop_device}p1 /mnt/boot || { echo "Failed to mount the User VM EFI partition" && exit 1; }
|
2019-09-18 16:06:16 +08:00
|
|
|
|
2020-04-03 14:52:34 +08:00
|
|
|
# set up mirror and proxy url while specified with m and p options
|
|
|
|
[[ -n $mirror ]] && echo "Setting swupd mirror to: $mirror" && \
|
|
|
|
sed -i 's/#allow_insecure_http=<true\/false>/allow_insecure_http=true/' /mnt$swupd_config && \
|
|
|
|
swupd mirror -s $mirror --path=/mnt
|
|
|
|
|
2019-09-18 16:06:16 +08:00
|
|
|
echo "Install kernel-iot-lts2018 to $uos_img"
|
2020-04-03 14:52:34 +08:00
|
|
|
swupd bundle-add --path=/mnt kernel-iot-lts2018 || { echo "Failed to install kernel-iot-lts2018" && \
|
|
|
|
sync && umount /mnt/boot /mnt && exit 1; }
|
2019-09-18 16:06:16 +08:00
|
|
|
|
|
|
|
echo "Configure kernel-ios-lts2018 as $uos_img default boot kernel"
|
|
|
|
uos_kernel_conf=`ls -t /mnt/boot/loader/entries/ | grep Clear-linux-iot-lts2018 | head -n1`
|
|
|
|
uos_kernel=${uos_kernel_conf%.conf}
|
|
|
|
echo "default $uos_kernel" > /mnt/boot/loader/loader.conf
|
|
|
|
|
|
|
|
umount /mnt/boot
|
2019-03-21 19:08:26 +08:00
|
|
|
umount /mnt
|
|
|
|
sync
|
|
|
|
|
2019-04-25 16:24:05 +08:00
|
|
|
cp -r /usr/share/acrn/samples/nuc/launch_uos.sh ~/launch_uos_$uos_ver.sh
|
|
|
|
sed -i "s/\(virtio-blk.*\)\/home\/clear\/uos\/uos.img/\1$(echo $uos_img | sed "s/\//\\\\\//g")/" ~/launch_uos_$uos_ver.sh
|
2019-11-07 08:56:43 +08:00
|
|
|
[[ -z `grep $uos_img ~/launch_uos_$uos_ver.sh` ]] && echo "Failed to replace the User VM image in the launch script: ~/launch_uos_$uos_ver.sh" && exit 1
|
|
|
|
echo "Upgrade User VM complete..."
|
|
|
|
echo "Run this command to start the User VM..."
|
2019-04-25 16:24:05 +08:00
|
|
|
echo "sudo /root/launch_uos_$uos_ver.sh"
|
2019-03-21 19:08:26 +08:00
|
|
|
exit
|
2019-03-15 16:48:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Set script options.
|
2019-10-25 19:42:27 +08:00
|
|
|
while getopts "s:u:p:m:e:kdhi" opt
|
2019-03-15 16:48:54 +08:00
|
|
|
do
|
|
|
|
case "$opt" in
|
2019-03-21 19:08:26 +08:00
|
|
|
s) sos_ver="$OPTARG"
|
|
|
|
;;
|
|
|
|
u) uos_ver="$OPTARG"
|
2019-03-15 16:48:54 +08:00
|
|
|
;;
|
|
|
|
p) proxy="$OPTARG"
|
|
|
|
;;
|
|
|
|
m) mirror="$OPTARG"
|
|
|
|
;;
|
2019-04-09 10:24:47 +08:00
|
|
|
e) efi_partition="$OPTARG"
|
|
|
|
;;
|
2019-03-21 19:08:26 +08:00
|
|
|
k) skip_download_uos=1
|
2019-03-15 16:48:54 +08:00
|
|
|
;;
|
2019-03-21 19:08:26 +08:00
|
|
|
d) disable_reboot=1
|
2019-03-15 16:48:54 +08:00
|
|
|
;;
|
|
|
|
h) print_help
|
|
|
|
;;
|
2019-10-28 14:23:23 +08:00
|
|
|
i) scenario=industry
|
2019-10-25 19:42:27 +08:00
|
|
|
;;
|
2019-03-15 16:48:54 +08:00
|
|
|
?) print_help
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2019-03-21 19:08:26 +08:00
|
|
|
# Check args
|
2019-11-07 08:56:43 +08:00
|
|
|
[[ $EUID -ne 0 ]] && echo "You must run the script as root." && exit 1
|
2019-03-21 19:08:26 +08:00
|
|
|
[[ -z $1 ]] && print_help
|
2019-11-07 08:56:43 +08:00
|
|
|
[[ -z $efi_partition ]] && efi_partition=/dev/sda1 || echo "Setting the EFI System partition to: $efi_partition..."
|
|
|
|
[[ -n $sos_ver && -n $uos_ver ]] && echo "Select upgrading the Service VM or the User VM" && exit 1
|
2019-03-21 19:08:26 +08:00
|
|
|
[[ -n $uos_ver ]] && upgrade_uos || upgrade_sos
|