]> xenbits.xensource.com Git - raisin.git/commitdiff
add a skip function in each components to disable the build
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 12 Oct 2015 16:28:18 +0000 (17:28 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 12 Oct 2015 16:28:18 +0000 (17:28 +0100)
Use it to disable building unnecessary components on ARM and ARM64.
Remove the manual checks.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
README
components/grub
components/libvirt
components/linux
components/ovmf
components/qemu
components/qemu_traditional
components/seabios
components/xen
lib/common-functions.sh

diff --git a/README b/README
index 7fec0896242c5bc2f9e78dcc73f42e9d30a6bca0..3a880e7b3e9b47025a6ebf6d2ae5efb41a2325b7 100644 (file)
--- a/README
+++ b/README
@@ -66,6 +66,11 @@ depends on Xen, should be built after Xen).
 
 You need to implement a few bash functions in the component script file:
 
+* component_skip
+return 0 if the component should be skipped, 1 if it should be enabled.
+It can be used to skip some components on platforms where they are not
+used, for example pvgrub on ARM.
+
 * component_check_package
 passes a list of build dependencies to check-package
 
index 703d681ea5fcfcddc467fb94083da5ba29da2cba..e6b615e69e5b2b5bded7e23996f83c429c2b1c67 100644 (file)
@@ -1,5 +1,14 @@
 #!/usr/bin/env bash
 
+function grub_skip() {
+    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+    then
+        return 0
+    else
+        return 1
+    fi
+}
+
 function grub_check_package() {
     local DEP_Debian_common="build-essential tar autoconf bison flex"
     local DEP_Debian_x86_32="$DEP_Debian_common"
@@ -16,24 +25,12 @@ function grub_check_package() {
     local DEP_CentOS_x86_32="$DEP_Fedora_x86_32"
     local DEP_CentOS_x86_64="$DEP_Fedora_x86_64"
 
-
-    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
-    then
-        verbose_echo grub is only supported on x86_32 and x86_64
-        return
-    fi
     verbose_echo Checking Grub dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
 
 function grub_build() {
-    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
-    then
-        verbose_echo grub is only supported on x86_32 and x86_64
-        return
-    fi
-
     cd "$BASEDIR"
     rm -f memdisk.tar
     tar cf memdisk.tar -C data grub.cfg
index 8ba642a20829290cce0c28eff0eb72a729ff199f..ae2f9ac66f672c250c952ab427e247da80d2be52 100644 (file)
@@ -1,5 +1,9 @@
 #!/usr/bin/env bash
 
+function libvirt_skip() {
+    return 1
+}
+
 function libvirt_check_package() {
     local DEP_Debian_common="build-essential libtool autoconf autopoint \
                              xsltproc libxml2-utils pkg-config python-dev   \
index 9ae69553a2feb0d3e757c77e892ebd640f4c0118..9de692c14fca1dab1bfe46be813f7eb1e623483a 100644 (file)
@@ -1,5 +1,9 @@
 #!/usr/bin/env bash
 
+function linux_skip() {
+    return 1
+}
+
 function linux_check_package() {
     local DEP_Debian_common="build-essential bc openssl"
     local DEP_Debian_x86_32="$DEP_Debian_common"
index 387044a3ea6bc2bba5e6a80daec90b86999b12df..ffdde19c3b7f545147d4585fc807f9c4d64be9e1 100644 (file)
@@ -1,5 +1,14 @@
 #!/usr/bin/env bash
 
+function ovmf_skip() {
+    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+    then
+        return 0
+    else
+        return 1
+    fi
+}
+
 function ovmf_check_package() {
     local DEP_Debian_common="build-essential nasm uuid-dev python iasl"
     local DEP_Debian_x86_32="$DEP_Debian_common"
@@ -11,24 +20,12 @@ function ovmf_check_package() {
     local DEP_Fedora_x86_32="$DEP_Fedora_common"
     local DEP_Fedora_x86_64="$DEP_Fedora_common"
 
-
-    if [[ $RAISIN_ARCH != "x86_64" ]]
-    then
-        verbose_echo ovmf is only supported on x86_64
-        return
-    fi
     verbose_echo Checking OVMF dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
 
 function ovmf_build() {
-    if [[ $RAISIN_ARCH != "x86_64" ]]
-    then
-        verbose_echo ovmf is only supported on x86_64
-        return
-    fi
-
     cd "$BASEDIR"
     git-checkout $OVMF_URL $OVMF_REVISION ovmf-dir
     cd ovmf-dir
index dce4ce0bf67ab46a537b88329c30db62c32be99a..e0d92a5a0d3469d450eaf383b8569afeebcbbae7 100644 (file)
@@ -1,5 +1,9 @@
 #!/usr/bin/env bash
 
+function qemu_skip() {
+    return 1
+}
+
 function qemu_check_package() {
     local DEP_Debian_common="build-essential libglib2.0-dev libpixman-1-dev"
     local DEP_Debian_x86_32="$DEP_Debian_common"
index ddf3db966a97f15cbe8b4ba06e6c63f930062161..3150c3e51fd99c9fcb8f782ae9691310dcd90424 100644 (file)
@@ -1,5 +1,14 @@
 #!/usr/bin/env bash
 
+function qemu_traditional_skip() {
+    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+    then
+        return 0
+    else
+        return 1
+    fi
+}
+
 function qemu_traditional_check_package() {
     local DEP_Debian_common="build-essential zlib1g-dev pciutils-dev pkg-config \
               libncurses5-dev"
@@ -10,23 +19,11 @@ function qemu_traditional_check_package() {
     local DEP_Fedora_x86_32="$DEP_Fedora_common"
     local DEP_Fedora_x86_64="$DEP_Fedora_common"
 
-    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
-    then
-        verbose_echo qemu_traditional is only supported on x86_32 and x86_64
-        return
-    fi
-
     verbose_echo Checking QEMU dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
 function qemu_traditional_build() {
-    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
-    then
-        verbose_echo qemu_traditional is only supported on x86_32 and x86_64
-        return
-    fi
-
     cd "$BASEDIR"
     git-checkout $QEMU_TRADITIONAL_URL $QEMU_TRADITIONAL_REVISION qemu_traditional-dir
     cd qemu_traditional-dir
index 8fea193a863dcb63f2bcc99bb356a6ca7fe0e4fd..9ce3fee77d6359803fcf6389707968a3ae218ebc 100644 (file)
@@ -1,5 +1,14 @@
 #!/usr/bin/env bash
 
+function seabios_skip() {
+    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+    then
+        return 0
+    else
+        return 1
+    fi
+}
+
 function seabios_check_package() {
     local DEP_Debian_common="build-essential iasl"
     local DEP_Debian_x86_32="$DEP_Debian_common"
@@ -11,24 +20,12 @@ function seabios_check_package() {
     local DEP_Fedora_x86_32="$DEP_Fedora_common"
     local DEP_Fedora_x86_64="$DEP_Fedora_common"
 
-
-    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
-    then
-        verbose_echo seabios is only supported on x86_32 and x86_64
-        return
-    fi
     verbose_echo Checking SeaBIOS dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
 
 function seabios_build() {
-    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
-    then
-        verbose_echo seabios is only supported on x86_32 and x86_64
-        return
-    fi
-
     cd "$BASEDIR"
     git-checkout $SEABIOS_URL $SEABIOS_REVISION seabios-dir
     cd seabios-dir
index 6b700e503422c61ffad0301d9e42b8a5e1f17458..090cceb56f3591f80db4c3deab3675b0dcd8fca4 100644 (file)
@@ -1,5 +1,9 @@
 #!/usr/bin/env bash
 
+function xen_skip() {
+    return 1
+}
+
 function xen_check_package() {
     local DEP_Debian_common="build-essential python-dev gettext uuid-dev   \
              libncurses5-dev libyajl-dev libaio-dev pkg-config libglib2.0-dev  \
index c222ce373e67a53864a6bc76f36fe73337083ba7..03642aeb60367fa00759a822d00574b727c3e70a 100644 (file)
@@ -301,7 +301,7 @@ function for_each_component () {
                 break
             fi
         done
-        if ! $found
+        if ! $found || "$component"_skip
         then
             verbose_echo "$component" is disabled
             continue