diff options
author | Thomas Abraham <thomas.abraham@arm.com> | 2018-09-10 17:54:08 +0530 |
---|---|---|
committer | Arvind Chauhan <arvind.chauhan@arm.com> | 2018-10-19 14:15:10 +0100 |
commit | ea368ecfaa413d3962e80a635e61a8e124e943fe (patch) | |
tree | 1d30253e806c431dd6c5bafc76bdbb8c3ac00944 | |
parent | 620396b28fb9646e0ea027ed4e5e579aa694bfcb (diff) |
sgi/distro_boot: fix useability issuesarmlt-20181030-001
Modifiy the distro-boot script to allow it to accept sata disk images which
are placed at any location in the host's filesystem. Also, as part of the
restructuring of the model scripts, modify the distro-boot script to adapt
it to the changes in the location of the run-model.sh script.
Change-Id: I8401a6e5a7a3bf1e24106fd4b88b490ddc2068c8
Signed-off-by: Thomas Abraham <thomas.abraham@arm.com>
-rwxr-xr-x | sgi/distro_boot.sh | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sgi/distro_boot.sh b/sgi/distro_boot.sh index cc7633e..2bc7cd2 100755 --- a/sgi/distro_boot.sh +++ b/sgi/distro_boot.sh @@ -22,7 +22,7 @@ __print_supported_sgi_platforms() install () { - disk_name=$RANDOM.satadisk + disk_name="$PWD/$RANDOM.satadisk" # Create a disk of $disk_size GB dd if=/dev/zero of=$disk_name bs=1G count=$disk_size @@ -38,24 +38,32 @@ install () boot () { + # Check if a installed sata disk image is supplied. If yes, boot from it. + if [ ! -z "$disk_image" ] ; then + dir_name="$(dirname $disk_image)" + if [ $dir_name == "." ] ; then + disk_image="$PWD/$disk_image" + fi + echo "Proceeding to boot supplied disk image name: $disk_image ..." + pushd $platform_dir + ./run_model.sh -d $disk_image -n $network -a "$extra_param" + exit 0 + fi + # If $disk_image is not specified, see if there are more than one # .satadisk files, if so, prompt the user to pick one with -d. # If there is exactly one available, boot it. If there are none, prompt # the user to install with -i/-s available_images=$(find . -name "*.satadisk") - num_available_images=$(echo $available_images | wc -w) case $num_available_images in - 0) - echo "No available images found to boot from, please install one, see distro_boot -h for help" - exit 1 - ;; 1) # In the case of exactly one, the list of images will # be the image name so just use it echo "Found $available_images, proceeding to boot ..." + available_images=$PWD/$available_images pushd $platform_dir ./run_model.sh -d $available_images -n $network -a "$extra_param" ;; @@ -67,10 +75,6 @@ boot () echo "" echo "Please choose one using distro_boot -d [disk_image]" echo "" - else - echo "Proceeding to boot supplied disk image name: $disk_image ..." - pushd $platform_dir - ./run_model.sh -d $disk_image -n $network -a "$extra_param" fi ;; esac |