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
This commit is contained in:
jorgefrancoibanez 2019-09-06 15:01:54 -04:00
parent 36d2edc24d
commit 24a0ea0195

View File

@ -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
;;