From 24a0ea0195febff2554d2275b9a30972f8071dee Mon Sep 17 00:00:00 2001 From: jorgefrancoibanez Date: Fri, 6 Sep 2019 15:01:54 -0400 Subject: [PATCH] Allow qemu-utils to be used to build image This patch allows build sahara images in ubuntu/debian distribution with qemu-utils package. Change-Id: Ibfa5c2550898a0d36b51057f5cd2b85f434b57f5 Story: 2006505 Task: 36483 --- diskimage-create/diskimage-create.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 44bde487..cb09165c 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -327,7 +327,7 @@ fi ################# is_installed() { - if [ "$platform" = 'ubuntu' ]; then + if [ "$platform" = 'ubuntu' -o "$platform" = 'debian' ]; then dpkg -s "$1" &> /dev/null else # centos, fedora, opensuse, or rhel @@ -339,8 +339,8 @@ is_installed() { need_required_packages() { case "$platform" in - "ubuntu") - package_list="qemu kpartx git" + "ubuntu" | "debian") + package_list="qemu-utils kpartx git" ;; "fedora") package_list="qemu-img kpartx git" @@ -359,6 +359,7 @@ need_required_packages() { for p in `echo $package_list`; do if ! is_installed $p; then + echo "Package $p is not installed on the system." return 0 fi done @@ -369,7 +370,7 @@ if need_required_packages; then # install required packages if requested if [ -n "$DIB_UPDATE_REQUESTED" ]; then case "$platform" in - "ubuntu") + "ubuntu" | "debian") sudo apt-get update sudo apt-get install $package_list -y ;;