All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] raisin: introduce ovmf and linux
@ 2015-04-21 14:54 Stefano Stabellini
  2015-04-21 14:54 ` [PATCH 1/5] raisin: introduce _verbose_echo Stefano Stabellini
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Stefano Stabellini @ 2015-04-21 14:54 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Stefano Stabellini

Hi all,

this patch series includes a few clean-ups and introduces a component to
build ovmf and a component to build a linux kernel. The latter is not
enabled by default, and could probably benefit from a bit more work on
the kconfig options to really be useful, but it is a start.


Stefano Stabellini (5):
      raisin: introduce _verbose_echo
      raisin: remove duplicate source config in raise
      raisin: rename ARCH to RAISIN_ARCH
      raisin: introduce ovmf
      raisin: build linux

 README                      |    2 +-
 components/grub             |    6 +--
 components/libvirt          |    2 +-
 components/linux            |  120 +++++++++++++++++++++++++++++++++++++++++++
 components/ovmf             |   60 ++++++++++++++++++++++
 components/qemu             |    2 +-
 components/qemu_traditional |    2 +-
 components/seabios          |    6 +--
 components/series           |    2 +
 components/xen              |    5 +-
 defconfig                   |    8 ++-
 lib/common-functions.sh     |   50 +++++++-----------
 raise                       |   15 ++----
 scripts/mkdeb               |    8 +--
 scripts/mkrpm               |    2 +-
 15 files changed, 229 insertions(+), 61 deletions(-)
 create mode 100644 components/linux
 create mode 100644 components/ovmf


Cheers,

Stefano

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/5] raisin: introduce _verbose_echo
  2015-04-21 14:54 [PATCH 0/5] raisin: introduce ovmf and linux Stefano Stabellini
@ 2015-04-21 14:54 ` Stefano Stabellini
  2015-04-21 15:09   ` George Dunlap
  2015-04-21 14:55 ` [PATCH 2/5] raisin: remove duplicate source config in raise Stefano Stabellini
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Stefano Stabellini @ 2015-04-21 14:54 UTC (permalink / raw)
  To: xen-devel; +Cc: george.dunlap, Stefano Stabellini

A new utility function to make the code more readable and compact:
prints a message if VERBOSE = 1.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 lib/common-functions.sh |   46 ++++++++++++++++------------------------------
 1 file changed, 16 insertions(+), 30 deletions(-)

diff --git a/lib/common-functions.sh b/lib/common-functions.sh
index dc3a2bb..c19046b 100644
--- a/lib/common-functions.sh
+++ b/lib/common-functions.sh
@@ -1,5 +1,12 @@
 #!/usr/bin/env bash
 
+function _verbose_echo() {
+    if [[ $VERBOSE -eq 1 ]]
+    then
+        echo $*
+    fi
+}
+
 # Executed once at the beginning of the script
 function common_init() {
     export BASEDIR=`pwd`
@@ -33,12 +40,9 @@ function common_init() {
     get_arch
     get_components
 
-    if [[ $VERBOSE -eq 1 ]]
-    then
-        echo "Distro: $DISTRO"
-        echo "Arch: $ARCH"
-        echo "Components: $COMPONENTS"
-    fi
+    _verbose_echo "Distro: $DISTRO"
+    _verbose_echo "Arch: $ARCH"
+    _verbose_echo "Components: $COMPONENTS"
 
     for f in $COMPONENTS
     do
@@ -62,10 +66,7 @@ function get_components() {
             if eval [[ ! -z \$"$capital"_REVISION ]]
             then
                 COMPONENTS="$COMPONENTS $component"
-                if [[ $VERBOSE -eq 1 ]]
-                then
-                    echo "Found component $component"
-                fi
+                _verbose_echo "Found component $component"
             fi
         done
     fi
@@ -166,10 +167,7 @@ function get_arch() {
 }
 
 function _check-package-deb() {
-    if [[ $VERBOSE -eq 1 ]]
-    then
-        echo "Checking for package ${args[0]}"
-    fi
+    _verbose_echo "Checking for package ${args[0]}"
 
     if dpkg -s "$1" 2>/dev/null | grep -q "Status:.*installed"
     then
@@ -184,10 +182,7 @@ function _install-package-deb() {
 }
 
 function _check-package-rpm() {
-    if [[ $VERBOSE -eq 1 ]]
-    then
-        echo "Checking for package $1"
-    fi
+    _verbose_echo "Checking for package $1"
 
     if rpm -q "$1" 2>&1 >/dev/null
     then
@@ -273,22 +268,13 @@ function for_each_component () {
         done
         if [[ $found -eq 0 ]]
         then
-            if [[ $VERBOSE -eq 1 ]]
-            then
-                echo "$component" is disabled
-            fi
+            _verbose_echo "$component" is disabled
             continue
         fi
 
-        if [[ $VERBOSE -eq 1 ]]
-        then
-            echo calling "$component"_"$1"
-        fi
+        _verbose_echo calling "$component"_"$1"
         "$component"_"$1"
-        if [[ $VERBOSE -eq 1 ]]
-        then
-            echo "$component"_"$1" done
-        fi
+        _verbose_echo "$component"_"$1" done
     done
 }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/5] raisin: remove duplicate source config in raise
  2015-04-21 14:54 [PATCH 0/5] raisin: introduce ovmf and linux Stefano Stabellini
  2015-04-21 14:54 ` [PATCH 1/5] raisin: introduce _verbose_echo Stefano Stabellini
@ 2015-04-21 14:55 ` Stefano Stabellini
  2015-04-21 15:09   ` George Dunlap
  2015-04-21 14:55 ` [PATCH 3/5] raisin: rename ARCH to RAISIN_ARCH Stefano Stabellini
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Stefano Stabellini @ 2015-04-21 14:55 UTC (permalink / raw)
  To: xen-devel; +Cc: george.dunlap, Stefano Stabellini

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 raise |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/raise b/raise
index bce6908..68dbfd8 100755
--- a/raise
+++ b/raise
@@ -17,9 +17,12 @@ _help() {
 }
 
 # Include your defaults
-if [[ -e "./config" ]] ; then
-    . ./config
+if [[ ! -e "./config" ]]
+then
+   echo "No config file found, copying default config"
+   cp defconfig config
 fi
+source ./config
 
 # To use this as a library, set RAISIN_PATH appropriately
 [[ -z "$RAISIN_PATH" ]] && RAISIN_PATH="$PWD/lib"
@@ -29,14 +32,6 @@ source ${RAISIN_PATH}/common-functions.sh
 source ${RAISIN_PATH}/git-checkout.sh
 source ${RAISIN_PATH}/commands.sh
 
-# Include your defaults
-if [[ ! -e "./config" ]] ; then
-   echo "No config file found, copying default config"
-   cp defconfig config
-fi
-
-source ./config
-
 # Set up basic functionality
 common_init
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/5] raisin: rename ARCH to RAISIN_ARCH
  2015-04-21 14:54 [PATCH 0/5] raisin: introduce ovmf and linux Stefano Stabellini
  2015-04-21 14:54 ` [PATCH 1/5] raisin: introduce _verbose_echo Stefano Stabellini
  2015-04-21 14:55 ` [PATCH 2/5] raisin: remove duplicate source config in raise Stefano Stabellini
@ 2015-04-21 14:55 ` Stefano Stabellini
  2015-04-21 15:09   ` George Dunlap
  2015-04-21 14:55 ` [PATCH 4/5] raisin: introduce ovmf Stefano Stabellini
  2015-04-21 14:55 ` [PATCH 5/5] raisin: build linux Stefano Stabellini
  4 siblings, 1 reply; 16+ messages in thread
From: Stefano Stabellini @ 2015-04-21 14:55 UTC (permalink / raw)
  To: xen-devel; +Cc: george.dunlap, Stefano Stabellini

Rename exported environmental variable ARCH to RAISIN_ARCH not to
conflict with any component Makefile variables.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 README                      |    2 +-
 components/grub             |    6 +++---
 components/libvirt          |    2 +-
 components/qemu             |    2 +-
 components/qemu_traditional |    2 +-
 components/seabios          |    6 +++---
 components/xen              |    2 +-
 lib/common-functions.sh     |    6 +++---
 scripts/mkdeb               |    8 ++++----
 scripts/mkrpm               |    2 +-
 10 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/README b/README
index ab8d3e7..b7832da 100644
--- a/README
+++ b/README
@@ -85,7 +85,7 @@ RAISIN_MAKE: make command to run
 SUDO: sudo command to run
 DISTRO: which Linux distribution we are running on, Debian, Fedora, etc
 PKGTYPE: which package format is used by the distro, rpm, deb, etc
-ARCH: which architecture we are running on, x86_64, arm32, etc.
+RAISIN_ARCH: which architecture we are running on, x86_64, arm32, etc.
 BASEDIR: absolute path of the raisin directory
 PREFIX: installation PREFIX
 INST_DIR: absolute path of the installation directory
diff --git a/components/grub b/components/grub
index 7c14a62..fa72b99 100644
--- a/components/grub
+++ b/components/grub
@@ -17,13 +17,13 @@ function grub_check_package() {
     local DEP_CentOS_x86_64="$DEP_Fedora_x86_64"
 
 
-    if [[ $ARCH != "x86_64" && $ARCH != "x86_32" ]]
+    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
     then
         echo grub is only supported on x86_32 and x86_64
         return
     fi
     echo Checking Grub dependencies
-    eval check-package \$DEP_"$DISTRO"_"$ARCH"
+    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
 
@@ -41,7 +41,7 @@ function grub_build() {
       -m ../memdisk.tar -o grub-i386-xen grub-core/*mod
     cp grub-i386-xen "$INST_DIR"/$PREFIX/lib/xen/boot
     ## GRUB64
-    if [[ $ARCH = "x86_64" ]]
+    if [[ $RAISIN_ARCH = "x86_64" ]]
     then
         $RAISIN_MAKE clean
         ./configure --target=amd64 --with-platform=xen
diff --git a/components/libvirt b/components/libvirt
index 5fb1a41..a554643 100644
--- a/components/libvirt
+++ b/components/libvirt
@@ -23,7 +23,7 @@ function libvirt_check_package() {
     local DEP_CentOS_x86_64="$DEP_Fedora_x86_64"
 
     echo Checking Libvirt dependencies
-    eval check-package \$DEP_"$DISTRO"_"$ARCH"
+    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
 function libvirt_build() {
diff --git a/components/qemu b/components/qemu
index 00aeeb6..72cfec1 100644
--- a/components/qemu
+++ b/components/qemu
@@ -12,7 +12,7 @@ function qemu_check_package() {
     local DEP_Fedora_x86_64="$DEP_Fedora_common"
 
     echo Checking QEMU dependencies
-    eval check-package \$DEP_"$DISTRO"_"$ARCH"
+    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
 function qemu_build() {
diff --git a/components/qemu_traditional b/components/qemu_traditional
index 500cbed..b338007 100644
--- a/components/qemu_traditional
+++ b/components/qemu_traditional
@@ -13,7 +13,7 @@ function qemu_traditional_check_package() {
     local DEP_Fedora_x86_64="$DEP_Fedora_common"
 
     echo Checking QEMU dependencies
-    eval check-package \$DEP_"$DISTRO"_"$ARCH"
+    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
 function qemu_traditional_build() {
diff --git a/components/seabios b/components/seabios
index 960a538..ed2c7d2 100644
--- a/components/seabios
+++ b/components/seabios
@@ -12,18 +12,18 @@ function seabios_check_package() {
     local DEP_Fedora_x86_64="$DEP_Fedora_common"
 
 
-    if [[ $ARCH != "x86_64" && $ARCH != "x86_32" ]]
+    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
     then
         echo seabios is only supported on x86_32 and x86_64
         return
     fi
     echo Checking SeaBIOS dependencies
-    eval check-package \$DEP_"$DISTRO"_"$ARCH"
+    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
 
 function seabios_build() {
-    if [[ $ARCH != "x86_64" && $ARCH != "x86_32" ]]
+    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
     then
         echo seabios is only supported on x86_32 and x86_64
         return
diff --git a/components/xen b/components/xen
index b7258b0..b3426f0 100644
--- a/components/xen
+++ b/components/xen
@@ -20,7 +20,7 @@ function xen_check_package() {
     local DEP_CentOS_x86_64="$DEP_CentOS_x86_32 glibc-devel.i686"
 
     echo Checking Xen dependencies
-    eval check-package \$DEP_"$DISTRO"_"$ARCH"
+    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
 function xen_build() {
diff --git a/lib/common-functions.sh b/lib/common-functions.sh
index c19046b..186a53b 100644
--- a/lib/common-functions.sh
+++ b/lib/common-functions.sh
@@ -41,7 +41,7 @@ function common_init() {
     get_components
 
     _verbose_echo "Distro: $DISTRO"
-    _verbose_echo "Arch: $ARCH"
+    _verbose_echo "Arch: $RAISIN_ARCH"
     _verbose_echo "Components: $COMPONENTS"
 
     for f in $COMPONENTS
@@ -161,7 +161,7 @@ function get_distro() {
 }
 
 function get_arch() {
-    export ARCH=`uname -m | sed -e s/i.86/x86_32/ -e s/i86pc/x86_32/ -e \
+    export RAISIN_ARCH=`uname -m | sed -e s/i.86/x86_32/ -e s/i86pc/x86_32/ -e \
                 s/amd64/x86_64/ -e s/armv7.*/arm32/ -e s/armv8.*/arm64/ \
                 -e s/aarch64/arm64/`
 }
@@ -296,7 +296,7 @@ function install_package() {
         $SUDO dpkg -i "$1".deb
     elif [[  $DISTRO = "Fedora" ]]
     then
-        $SUDO rpm -i --force "$1"-`git show --oneline | head -1 | cut -d " " -f 1`-0.$ARCH.rpm
+        $SUDO rpm -i --force "$1"-`git show --oneline | head -1 | cut -d " " -f 1`-0.$RAISIN_ARCH.rpm
     else
         echo "Don't know how to install packages on $DISTRO"
     fi
diff --git a/scripts/mkdeb b/scripts/mkdeb
index 0225736..dbd92bd 100755
--- a/scripts/mkdeb
+++ b/scripts/mkdeb
@@ -3,7 +3,7 @@
 # mkdeb: package $INST_DIR output in a .deb 
 #
 # Takes 1 argument: the package name
-# It relies on ARCH and INST_DIR being set correctly
+# It relies on RAISIN_ARCH and INST_DIR being set correctly
 
 set -e
 
@@ -18,12 +18,12 @@ name=$1
 cd "$BASEDIR"
 
 # map the architecture, if necessary
-case "$ARCH" in
+case "$RAISIN_ARCH" in
   x86_32|x86_32p)  arch=i386 ;;
   x86_64)  arch=amd64 ;;
   arm32)   arch=armhf ;;
-  arm64)   arch=$ARCH;;
-  *) echo "Unknown ARCH $ARCH" >&2
+  arm64)   arch=$RAISIN_ARCH;;
+  *) echo "Unknown ARCH $RAISIN_ARCH" >&2
      exit 1
      ;;
 esac
diff --git a/scripts/mkrpm b/scripts/mkrpm
index 8de4508..7965c0c 100755
--- a/scripts/mkrpm
+++ b/scripts/mkrpm
@@ -3,7 +3,7 @@
 # mkrpm: package INST_DIR in an .rpm
 #
 # Takes 1 argument: the package name
-# It relies on ARCH and INST_DIR being set correctly
+# It relies on INST_DIR being set correctly
 
 set -e
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/5] raisin: introduce ovmf
  2015-04-21 14:54 [PATCH 0/5] raisin: introduce ovmf and linux Stefano Stabellini
                   ` (2 preceding siblings ...)
  2015-04-21 14:55 ` [PATCH 3/5] raisin: rename ARCH to RAISIN_ARCH Stefano Stabellini
@ 2015-04-21 14:55 ` Stefano Stabellini
  2015-04-21 15:03   ` George Dunlap
  2015-04-21 14:55 ` [PATCH 5/5] raisin: build linux Stefano Stabellini
  4 siblings, 1 reply; 16+ messages in thread
From: Stefano Stabellini @ 2015-04-21 14:55 UTC (permalink / raw)
  To: xen-devel; +Cc: george.dunlap, Stefano Stabellini

Add a component to build ovmf and pass the output binary to the xen
build.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 components/ovmf   |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 components/series |    1 +
 components/xen    |    3 ++-
 defconfig         |    6 ++++--
 4 files changed, 67 insertions(+), 3 deletions(-)
 create mode 100644 components/ovmf

diff --git a/components/ovmf b/components/ovmf
new file mode 100644
index 0000000..a59a771
--- /dev/null
+++ b/components/ovmf
@@ -0,0 +1,60 @@
+#!/usr/bin/env bash
+
+function ovmf_check_package() {
+    local DEP_Debian_common="build-essential nasm uuid-dev python iasl"
+    local DEP_Debian_x86_32="$DEP_Debian_common"
+    local DEP_Debian_x86_64="$DEP_Debian_common"
+    local DEP_Debian_arm32="$DEP_Debian_common"
+    local DEP_Debian_arm64="$DEP_Debian_common"
+
+    local DEP_Fedora_common="make gcc gcc-c++ nasm libuuid-devel python acpica-tools"
+    local DEP_Fedora_x86_32="$DEP_Fedora_common"
+    local DEP_Fedora_x86_64="$DEP_Fedora_common"
+
+
+    if [[ $RAISIN_ARCH != "x86_64" ]]
+    then
+        echo ovmf is only supported on x86_64
+        return
+    fi
+    echo Checking OVMF dependencies
+    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
+}
+
+
+function ovmf_build() {
+    if [[ $RAISIN_ARCH != "x86_64" ]]
+    then
+        echo ovmf is only supported on x86_64
+        return
+    fi
+
+    cd "$BASEDIR"
+    git-checkout $OVMF_URL $OVMF_REVISION ovmf-dir
+    cd ovmf-dir
+
+    make -C BaseTools/Source/C
+    OvmfPkg/build.sh -a X64 -b RELEASE -n 4
+    cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin
+
+    cd "$BASEDIR"
+}
+
+function ovmf_clean() {
+    cd "$BASEDIR"
+    if [[ -d ovmf-dir ]]
+    then
+        cd ovmf-dir
+        $GIT clean -fdx
+        cd ..
+        rm -rf ovmf-dir
+    fi
+}
+
+function ovmf_configure() {
+    :
+}
+
+function ovmf_unconfigure() {
+    :
+}
diff --git a/components/series b/components/series
index f0f3cfa..fe9092a 100644
--- a/components/series
+++ b/components/series
@@ -1,4 +1,5 @@
 seabios
+ovmf
 xen
 qemu
 qemu_traditional
diff --git a/components/xen b/components/xen
index b3426f0..b3a0c96 100644
--- a/components/xen
+++ b/components/xen
@@ -29,7 +29,8 @@ function xen_build() {
     cd xen-dir
     ./configure --prefix=$PREFIX --with-system-qemu=$PREFIX/lib/xen/bin/qemu-system-i386 \
         --disable-qemu-traditional --enable-rombios \
-        --with-system-seabios="$BASEDIR"/seabios-dir/out/bios.bin
+        --with-system-seabios="$BASEDIR"/seabios-dir/out/bios.bin \
+        --with-system-ovmf="$BASEDIR"/ovmf-dir/ovmf.bin
     $RAISIN_MAKE
     $RAISIN_MAKE install DESTDIR="$INST_DIR"
     cd "$BASEDIR"
diff --git a/defconfig b/defconfig
index d3ef283..7d2a3f7 100644
--- a/defconfig
+++ b/defconfig
@@ -1,12 +1,12 @@
 # Config variables for raisin
 
 # Components
-## All components: seabios xen qemu qemu_traditional grub libvirt
+## All components: seabios ovmf xen qemu qemu_traditional grub libvirt
 ## Core xen functionality: xen
 ## Remove a component from the list below, if you want to disable it
 ## You can manually overwrite this list using the COMPONENTS
 ## environmental variable.
-ENABLED_COMPONENTS="seabios xen qemu qemu_traditional grub libvirt"
+ENABLED_COMPONENTS="seabios ovmf xen qemu qemu_traditional grub libvirt"
 
 # Build config
 ## Make command to run
@@ -27,6 +27,7 @@ QEMU_TRADITIONAL_URL="git://xenbits.xen.org/qemu-xen-unstable.git"
 SEABIOS_URL="git://xenbits.xen.org/seabios.git"
 GRUB_URL="git://git.savannah.gnu.org/grub.git"
 LIBVIRT_URL="git://libvirt.org/libvirt.git"
+OVMF_URL="git://xenbits.xen.org/ovmf.git"
 
 # Software versions.
 XEN_REVISION="master"
@@ -35,3 +36,4 @@ QEMU_TRADITIONAL_REVISION="master"
 SEABIOS_REVISION="master"
 GRUB_REVISION="master"
 LIBVIRT_REVISION="master"
+OVMF_REVISION="master"
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 5/5] raisin: build linux
  2015-04-21 14:54 [PATCH 0/5] raisin: introduce ovmf and linux Stefano Stabellini
                   ` (3 preceding siblings ...)
  2015-04-21 14:55 ` [PATCH 4/5] raisin: introduce ovmf Stefano Stabellini
@ 2015-04-21 14:55 ` Stefano Stabellini
  2015-04-21 15:11   ` George Dunlap
  4 siblings, 1 reply; 16+ messages in thread
From: Stefano Stabellini @ 2015-04-21 14:55 UTC (permalink / raw)
  To: xen-devel; +Cc: george.dunlap, Stefano Stabellini

Add a component, disabled by default, to build a linux kernel with the
Xen kconfig options enabled.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 components/linux  |  120 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 components/series |    1 +
 defconfig         |    4 +-
 3 files changed, 124 insertions(+), 1 deletion(-)
 create mode 100644 components/linux

diff --git a/components/linux b/components/linux
new file mode 100644
index 0000000..f90a894
--- /dev/null
+++ b/components/linux
@@ -0,0 +1,120 @@
+#!/usr/bin/env bash
+
+function linux_check_package() {
+    local DEP_Debian_common="build-essential bc openssl"
+    local DEP_Debian_x86_32="$DEP_Debian_common"
+    local DEP_Debian_x86_64="$DEP_Debian_common"
+    local DEP_Debian_arm32="$DEP_Debian_common"
+    local DEP_Debian_arm64="$DEP_Debian_common"
+
+    local DEP_Fedora_common="make gcc bc openssl"
+    local DEP_Fedora_x86_32="$DEP_Fedora_common"
+    local DEP_Fedora_x86_64="$DEP_Fedora_common"
+
+    local DEP_CentOS_common="$DEP_Fedora_common"
+    local DEP_CentOS_x86_32="$DEP_Fedora_x86_32"
+    local DEP_CentOS_x86_64="$DEP_Fedora_x86_64"
+
+    echo Checking Linux dependencies
+    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
+}
+
+function _xenify_config() {
+    echo "CONFIG_HYPERVISOR_GUEST=y" >> $1
+    echo "CONFIG_PARAVIRT=y" >> $1
+    echo "CONFIG_PARAVIRT_SPINLOCKS=y" >> $1
+    echo "CONFIG_XEN=y" >> $1
+    echo "CONFIG_XEN_DOM0=y" >> $1
+    echo "CONFIG_XEN_PVHVM=y" >> $1
+    echo "CONFIG_XEN_SAVE_RESTORE=y" >> $1
+    echo "CONFIG_XEN_DEBUG_FS=y" >> $1
+    echo "CONFIG_XEN_PVH=y" >> $1
+    echo "CONFIG_PARAVIRT_CLOCK=y" >> $1
+    echo "CONFIG_BALLOON_COMPACTION=y" >> $1
+    echo "CONFIG_XEN_PCIDEV_FRONTEND=y" >> $1
+    echo "CONFIG_XEN_BLKDEV_FRONTEND=y" >> $1
+    echo "CONFIG_XEN_BLKDEV_BACKEND=y" >> $1
+    echo "CONFIG_XEN_SCSI_FRONTEND=y" >> $1
+    echo "CONFIG_XEN_NETDEV_FRONTEND=y" >> $1
+    echo "CONFIG_XEN_NETDEV_BACKEND=y" >> $1
+    echo "CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y" >> $1
+    echo "CONFIG_XEN_FBDEV_FRONTEND=y" >> $1
+    echo "CONFIG_HVC_XEN=y" >> $1
+    echo "CONFIG_HVC_XEN_FRONTEND=y" >> $1
+    echo "CONFIG_XEN_BALLOON=y" >> $1
+    echo "CONFIG_XEN_SCRUB_PAGES=y" >> $1
+    echo "CONFIG_XEN_DEV_EVTCHN=y" >> $1
+    echo "CONFIG_XEN_BACKEND=y" >> $1
+    echo "CONFIG_XENFS=y" >> $1
+    echo "CONFIG_XEN_COMPAT_XENFS=y" >> $1
+    echo "CONFIG_XEN_SYS_HYPERVISOR=y" >> $1
+    echo "CONFIG_XEN_XENBUS_FRONTEND=y" >> $1
+    echo "CONFIG_XEN_GNTDEV=y" >> $1
+    echo "CONFIG_XEN_GRANT_DEV_ALLOC=y" >> $1
+    echo "CONFIG_SWIOTLB_XEN=y" >> $1
+    echo "CONFIG_XEN_PCIDEV_BACKEND=y" >> $1
+    echo "CONFIG_XEN_PRIVCMD=y" >> $1
+    echo "CONFIG_XEN_HAVE_PVMMU=y" >> $1
+    echo "CONFIG_XEN_ACPI_PROCESSOR=y" >> $1
+    echo "CONFIG_XEN_EFI=y" >> $1
+    echo "CONFIG_XEN_AUTO_XLATE=y" >> $1
+    echo "CONFIG_BRIDGE=y" >> $1
+}
+
+function linux_build() {
+    local vmlinuz
+
+    cd "$BASEDIR"
+    git-checkout $LINUX_URL $LINUX_REVISION linux-dir
+    cd linux-dir
+
+    if [[ ! -e .config ]]
+    then
+        if [[ -e /boot/config-`uname -r` ]]
+        then
+            cp /boot/config-`uname -r` .config
+        else
+            $RAISIN_MAKE defconfig
+        fi
+        _xenify_config .config
+        $RAISIN_MAKE olddefconfig
+    fi
+
+    $RAISIN_MAKE
+    $RAISIN_MAKE modules_install INSTALL_MOD_PATH="$INST_DIR"
+
+    mkdir -p "$INST_DIR"/boot/xen
+    vmlinuz="$INST_DIR"/boot/xen/vmlinuz-$RAISIN_ARCH-$LINUX_REVISION-`date +"%Y%m%d.%H%M%S"`
+
+    if [[ $RAISIN_ARCH = "x86_64" || $RAISIN_ARCH = "x86_32" ]]
+    then
+        cp arch/x86/boot/bzImage "$vmlinuz"
+    elif [[ $RAISIN_ARCH = "arm32" ]]
+    then
+        cp arch/arm/boot/zImage "$vmlinuz"
+    elif [[ $RAISIN_ARCH = "arm64" ]]
+    then
+        cp arch/x86/boot/Image.gz "$vmlinuz"
+    fi
+
+    cd ..
+}
+
+function linux_clean() {
+    cd "$BASEDIR"
+    if [[ -d linux-dir ]]
+    then
+        cd linux-dir
+        $RAISIN_MAKE distclean
+        cd ..
+        rm -rf linux-dir
+    fi
+}
+
+function linux_configure() {
+    :
+}
+
+function linux_unconfigure() {
+    :
+}
diff --git a/components/series b/components/series
index fe9092a..928e78e 100644
--- a/components/series
+++ b/components/series
@@ -5,3 +5,4 @@ qemu
 qemu_traditional
 grub
 libvirt
+linux
diff --git a/defconfig b/defconfig
index 7d2a3f7..b4ed94d 100644
--- a/defconfig
+++ b/defconfig
@@ -1,7 +1,7 @@
 # Config variables for raisin
 
 # Components
-## All components: seabios ovmf xen qemu qemu_traditional grub libvirt
+## All components: seabios ovmf xen qemu qemu_traditional grub libvirt linux
 ## Core xen functionality: xen
 ## Remove a component from the list below, if you want to disable it
 ## You can manually overwrite this list using the COMPONENTS
@@ -28,6 +28,7 @@ SEABIOS_URL="git://xenbits.xen.org/seabios.git"
 GRUB_URL="git://git.savannah.gnu.org/grub.git"
 LIBVIRT_URL="git://libvirt.org/libvirt.git"
 OVMF_URL="git://xenbits.xen.org/ovmf.git"
+LINUX_URL="git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git"
 
 # Software versions.
 XEN_REVISION="master"
@@ -37,3 +38,4 @@ SEABIOS_REVISION="master"
 GRUB_REVISION="master"
 LIBVIRT_REVISION="master"
 OVMF_REVISION="master"
+LINUX_REVISION="master"
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/5] raisin: introduce ovmf
  2015-04-21 14:55 ` [PATCH 4/5] raisin: introduce ovmf Stefano Stabellini
@ 2015-04-21 15:03   ` George Dunlap
  2015-04-21 15:43     ` Stefano Stabellini
  0 siblings, 1 reply; 16+ messages in thread
From: George Dunlap @ 2015-04-21 15:03 UTC (permalink / raw)
  To: Stefano Stabellini, xen-devel; +Cc: george.dunlap

On 04/21/2015 03:55 PM, Stefano Stabellini wrote:
> diff --git a/components/series b/components/series
> index f0f3cfa..fe9092a 100644
> --- a/components/series
> +++ b/components/series
> @@ -1,4 +1,5 @@
>  seabios
> +ovmf
>  xen
>  qemu
>  qemu_traditional
> diff --git a/components/xen b/components/xen
> index b3426f0..b3a0c96 100644
> --- a/components/xen
> +++ b/components/xen
> @@ -29,7 +29,8 @@ function xen_build() {
>      cd xen-dir
>      ./configure --prefix=$PREFIX --with-system-qemu=$PREFIX/lib/xen/bin/qemu-system-i386 \
>          --disable-qemu-traditional --enable-rombios \
> -        --with-system-seabios="$BASEDIR"/seabios-dir/out/bios.bin
> +        --with-system-seabios="$BASEDIR"/seabios-dir/out/bios.bin \
> +        --with-system-ovmf="$BASEDIR"/ovmf-dir/ovmf.bin

Does this still work if you don't build ovmf?

 -George

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/5] raisin: introduce _verbose_echo
  2015-04-21 14:54 ` [PATCH 1/5] raisin: introduce _verbose_echo Stefano Stabellini
@ 2015-04-21 15:09   ` George Dunlap
  2015-04-21 15:37     ` Stefano Stabellini
  0 siblings, 1 reply; 16+ messages in thread
From: George Dunlap @ 2015-04-21 15:09 UTC (permalink / raw)
  To: Stefano Stabellini, xen-devel; +Cc: george.dunlap

On 04/21/2015 03:54 PM, Stefano Stabellini wrote:
> A new utility function to make the code more readable and compact:
> prints a message if VERBOSE = 1.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> ---
>  lib/common-functions.sh |   46 ++++++++++++++++------------------------------
>  1 file changed, 16 insertions(+), 30 deletions(-)
> 
> diff --git a/lib/common-functions.sh b/lib/common-functions.sh
> index dc3a2bb..c19046b 100644
> --- a/lib/common-functions.sh
> +++ b/lib/common-functions.sh
> @@ -1,5 +1,12 @@
>  #!/usr/bin/env bash
>  
> +function _verbose_echo() {
> +    if [[ $VERBOSE -eq 1 ]]
> +    then
> +        echo $*
> +    fi
> +}

Why _?  Don't we have VERBOSE in other parts of the code that could call
this?

 -George

> +
>  # Executed once at the beginning of the script
>  function common_init() {
>      export BASEDIR=`pwd`
> @@ -33,12 +40,9 @@ function common_init() {
>      get_arch
>      get_components
>  
> -    if [[ $VERBOSE -eq 1 ]]
> -    then
> -        echo "Distro: $DISTRO"
> -        echo "Arch: $ARCH"
> -        echo "Components: $COMPONENTS"
> -    fi
> +    _verbose_echo "Distro: $DISTRO"
> +    _verbose_echo "Arch: $ARCH"
> +    _verbose_echo "Components: $COMPONENTS"
>  
>      for f in $COMPONENTS
>      do
> @@ -62,10 +66,7 @@ function get_components() {
>              if eval [[ ! -z \$"$capital"_REVISION ]]
>              then
>                  COMPONENTS="$COMPONENTS $component"
> -                if [[ $VERBOSE -eq 1 ]]
> -                then
> -                    echo "Found component $component"
> -                fi
> +                _verbose_echo "Found component $component"
>              fi
>          done
>      fi
> @@ -166,10 +167,7 @@ function get_arch() {
>  }
>  
>  function _check-package-deb() {
> -    if [[ $VERBOSE -eq 1 ]]
> -    then
> -        echo "Checking for package ${args[0]}"
> -    fi
> +    _verbose_echo "Checking for package ${args[0]}"
>  
>      if dpkg -s "$1" 2>/dev/null | grep -q "Status:.*installed"
>      then
> @@ -184,10 +182,7 @@ function _install-package-deb() {
>  }
>  
>  function _check-package-rpm() {
> -    if [[ $VERBOSE -eq 1 ]]
> -    then
> -        echo "Checking for package $1"
> -    fi
> +    _verbose_echo "Checking for package $1"
>  
>      if rpm -q "$1" 2>&1 >/dev/null
>      then
> @@ -273,22 +268,13 @@ function for_each_component () {
>          done
>          if [[ $found -eq 0 ]]
>          then
> -            if [[ $VERBOSE -eq 1 ]]
> -            then
> -                echo "$component" is disabled
> -            fi
> +            _verbose_echo "$component" is disabled
>              continue
>          fi
>  
> -        if [[ $VERBOSE -eq 1 ]]
> -        then
> -            echo calling "$component"_"$1"
> -        fi
> +        _verbose_echo calling "$component"_"$1"
>          "$component"_"$1"
> -        if [[ $VERBOSE -eq 1 ]]
> -        then
> -            echo "$component"_"$1" done
> -        fi
> +        _verbose_echo "$component"_"$1" done
>      done
>  }
>  
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/5] raisin: remove duplicate source config in raise
  2015-04-21 14:55 ` [PATCH 2/5] raisin: remove duplicate source config in raise Stefano Stabellini
@ 2015-04-21 15:09   ` George Dunlap
  2015-04-21 15:42     ` Stefano Stabellini
  0 siblings, 1 reply; 16+ messages in thread
From: George Dunlap @ 2015-04-21 15:09 UTC (permalink / raw)
  To: Stefano Stabellini, xen-devel; +Cc: george.dunlap

On 04/21/2015 03:55 PM, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

I take it this got here by a bad merge or somethign?

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

> ---
>  raise |   15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/raise b/raise
> index bce6908..68dbfd8 100755
> --- a/raise
> +++ b/raise
> @@ -17,9 +17,12 @@ _help() {
>  }
>  
>  # Include your defaults
> -if [[ -e "./config" ]] ; then
> -    . ./config
> +if [[ ! -e "./config" ]]
> +then
> +   echo "No config file found, copying default config"
> +   cp defconfig config
>  fi
> +source ./config
>  
>  # To use this as a library, set RAISIN_PATH appropriately
>  [[ -z "$RAISIN_PATH" ]] && RAISIN_PATH="$PWD/lib"
> @@ -29,14 +32,6 @@ source ${RAISIN_PATH}/common-functions.sh
>  source ${RAISIN_PATH}/git-checkout.sh
>  source ${RAISIN_PATH}/commands.sh
>  
> -# Include your defaults
> -if [[ ! -e "./config" ]] ; then
> -   echo "No config file found, copying default config"
> -   cp defconfig config
> -fi
> -
> -source ./config
> -
>  # Set up basic functionality
>  common_init
>  
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/5] raisin: rename ARCH to RAISIN_ARCH
  2015-04-21 14:55 ` [PATCH 3/5] raisin: rename ARCH to RAISIN_ARCH Stefano Stabellini
@ 2015-04-21 15:09   ` George Dunlap
  0 siblings, 0 replies; 16+ messages in thread
From: George Dunlap @ 2015-04-21 15:09 UTC (permalink / raw)
  To: Stefano Stabellini, xen-devel; +Cc: george.dunlap

On 04/21/2015 03:55 PM, Stefano Stabellini wrote:
> Rename exported environmental variable ARCH to RAISIN_ARCH not to
> conflict with any component Makefile variables.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

> ---
>  README                      |    2 +-
>  components/grub             |    6 +++---
>  components/libvirt          |    2 +-
>  components/qemu             |    2 +-
>  components/qemu_traditional |    2 +-
>  components/seabios          |    6 +++---
>  components/xen              |    2 +-
>  lib/common-functions.sh     |    6 +++---
>  scripts/mkdeb               |    8 ++++----
>  scripts/mkrpm               |    2 +-
>  10 files changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/README b/README
> index ab8d3e7..b7832da 100644
> --- a/README
> +++ b/README
> @@ -85,7 +85,7 @@ RAISIN_MAKE: make command to run
>  SUDO: sudo command to run
>  DISTRO: which Linux distribution we are running on, Debian, Fedora, etc
>  PKGTYPE: which package format is used by the distro, rpm, deb, etc
> -ARCH: which architecture we are running on, x86_64, arm32, etc.
> +RAISIN_ARCH: which architecture we are running on, x86_64, arm32, etc.
>  BASEDIR: absolute path of the raisin directory
>  PREFIX: installation PREFIX
>  INST_DIR: absolute path of the installation directory
> diff --git a/components/grub b/components/grub
> index 7c14a62..fa72b99 100644
> --- a/components/grub
> +++ b/components/grub
> @@ -17,13 +17,13 @@ function grub_check_package() {
>      local DEP_CentOS_x86_64="$DEP_Fedora_x86_64"
>  
>  
> -    if [[ $ARCH != "x86_64" && $ARCH != "x86_32" ]]
> +    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
>      then
>          echo grub is only supported on x86_32 and x86_64
>          return
>      fi
>      echo Checking Grub dependencies
> -    eval check-package \$DEP_"$DISTRO"_"$ARCH"
> +    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
>  }
>  
>  
> @@ -41,7 +41,7 @@ function grub_build() {
>        -m ../memdisk.tar -o grub-i386-xen grub-core/*mod
>      cp grub-i386-xen "$INST_DIR"/$PREFIX/lib/xen/boot
>      ## GRUB64
> -    if [[ $ARCH = "x86_64" ]]
> +    if [[ $RAISIN_ARCH = "x86_64" ]]
>      then
>          $RAISIN_MAKE clean
>          ./configure --target=amd64 --with-platform=xen
> diff --git a/components/libvirt b/components/libvirt
> index 5fb1a41..a554643 100644
> --- a/components/libvirt
> +++ b/components/libvirt
> @@ -23,7 +23,7 @@ function libvirt_check_package() {
>      local DEP_CentOS_x86_64="$DEP_Fedora_x86_64"
>  
>      echo Checking Libvirt dependencies
> -    eval check-package \$DEP_"$DISTRO"_"$ARCH"
> +    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
>  }
>  
>  function libvirt_build() {
> diff --git a/components/qemu b/components/qemu
> index 00aeeb6..72cfec1 100644
> --- a/components/qemu
> +++ b/components/qemu
> @@ -12,7 +12,7 @@ function qemu_check_package() {
>      local DEP_Fedora_x86_64="$DEP_Fedora_common"
>  
>      echo Checking QEMU dependencies
> -    eval check-package \$DEP_"$DISTRO"_"$ARCH"
> +    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
>  }
>  
>  function qemu_build() {
> diff --git a/components/qemu_traditional b/components/qemu_traditional
> index 500cbed..b338007 100644
> --- a/components/qemu_traditional
> +++ b/components/qemu_traditional
> @@ -13,7 +13,7 @@ function qemu_traditional_check_package() {
>      local DEP_Fedora_x86_64="$DEP_Fedora_common"
>  
>      echo Checking QEMU dependencies
> -    eval check-package \$DEP_"$DISTRO"_"$ARCH"
> +    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
>  }
>  
>  function qemu_traditional_build() {
> diff --git a/components/seabios b/components/seabios
> index 960a538..ed2c7d2 100644
> --- a/components/seabios
> +++ b/components/seabios
> @@ -12,18 +12,18 @@ function seabios_check_package() {
>      local DEP_Fedora_x86_64="$DEP_Fedora_common"
>  
>  
> -    if [[ $ARCH != "x86_64" && $ARCH != "x86_32" ]]
> +    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
>      then
>          echo seabios is only supported on x86_32 and x86_64
>          return
>      fi
>      echo Checking SeaBIOS dependencies
> -    eval check-package \$DEP_"$DISTRO"_"$ARCH"
> +    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
>  }
>  
>  
>  function seabios_build() {
> -    if [[ $ARCH != "x86_64" && $ARCH != "x86_32" ]]
> +    if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
>      then
>          echo seabios is only supported on x86_32 and x86_64
>          return
> diff --git a/components/xen b/components/xen
> index b7258b0..b3426f0 100644
> --- a/components/xen
> +++ b/components/xen
> @@ -20,7 +20,7 @@ function xen_check_package() {
>      local DEP_CentOS_x86_64="$DEP_CentOS_x86_32 glibc-devel.i686"
>  
>      echo Checking Xen dependencies
> -    eval check-package \$DEP_"$DISTRO"_"$ARCH"
> +    eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
>  }
>  
>  function xen_build() {
> diff --git a/lib/common-functions.sh b/lib/common-functions.sh
> index c19046b..186a53b 100644
> --- a/lib/common-functions.sh
> +++ b/lib/common-functions.sh
> @@ -41,7 +41,7 @@ function common_init() {
>      get_components
>  
>      _verbose_echo "Distro: $DISTRO"
> -    _verbose_echo "Arch: $ARCH"
> +    _verbose_echo "Arch: $RAISIN_ARCH"
>      _verbose_echo "Components: $COMPONENTS"
>  
>      for f in $COMPONENTS
> @@ -161,7 +161,7 @@ function get_distro() {
>  }
>  
>  function get_arch() {
> -    export ARCH=`uname -m | sed -e s/i.86/x86_32/ -e s/i86pc/x86_32/ -e \
> +    export RAISIN_ARCH=`uname -m | sed -e s/i.86/x86_32/ -e s/i86pc/x86_32/ -e \
>                  s/amd64/x86_64/ -e s/armv7.*/arm32/ -e s/armv8.*/arm64/ \
>                  -e s/aarch64/arm64/`
>  }
> @@ -296,7 +296,7 @@ function install_package() {
>          $SUDO dpkg -i "$1".deb
>      elif [[  $DISTRO = "Fedora" ]]
>      then
> -        $SUDO rpm -i --force "$1"-`git show --oneline | head -1 | cut -d " " -f 1`-0.$ARCH.rpm
> +        $SUDO rpm -i --force "$1"-`git show --oneline | head -1 | cut -d " " -f 1`-0.$RAISIN_ARCH.rpm
>      else
>          echo "Don't know how to install packages on $DISTRO"
>      fi
> diff --git a/scripts/mkdeb b/scripts/mkdeb
> index 0225736..dbd92bd 100755
> --- a/scripts/mkdeb
> +++ b/scripts/mkdeb
> @@ -3,7 +3,7 @@
>  # mkdeb: package $INST_DIR output in a .deb 
>  #
>  # Takes 1 argument: the package name
> -# It relies on ARCH and INST_DIR being set correctly
> +# It relies on RAISIN_ARCH and INST_DIR being set correctly
>  
>  set -e
>  
> @@ -18,12 +18,12 @@ name=$1
>  cd "$BASEDIR"
>  
>  # map the architecture, if necessary
> -case "$ARCH" in
> +case "$RAISIN_ARCH" in
>    x86_32|x86_32p)  arch=i386 ;;
>    x86_64)  arch=amd64 ;;
>    arm32)   arch=armhf ;;
> -  arm64)   arch=$ARCH;;
> -  *) echo "Unknown ARCH $ARCH" >&2
> +  arm64)   arch=$RAISIN_ARCH;;
> +  *) echo "Unknown ARCH $RAISIN_ARCH" >&2
>       exit 1
>       ;;
>  esac
> diff --git a/scripts/mkrpm b/scripts/mkrpm
> index 8de4508..7965c0c 100755
> --- a/scripts/mkrpm
> +++ b/scripts/mkrpm
> @@ -3,7 +3,7 @@
>  # mkrpm: package INST_DIR in an .rpm
>  #
>  # Takes 1 argument: the package name
> -# It relies on ARCH and INST_DIR being set correctly
> +# It relies on INST_DIR being set correctly
>  
>  set -e
>  
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 5/5] raisin: build linux
  2015-04-21 14:55 ` [PATCH 5/5] raisin: build linux Stefano Stabellini
@ 2015-04-21 15:11   ` George Dunlap
  0 siblings, 0 replies; 16+ messages in thread
From: George Dunlap @ 2015-04-21 15:11 UTC (permalink / raw)
  To: Stefano Stabellini, xen-devel; +Cc: george.dunlap

On 04/21/2015 03:55 PM, Stefano Stabellini wrote:
> Add a component, disabled by default, to build a linux kernel with the
> Xen kconfig options enabled.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

I'm wondering if at some point we might want to give people the option
to pass in a specific Linux config; but that can be a feature for
another patch.

 -George

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/5] raisin: introduce _verbose_echo
  2015-04-21 15:09   ` George Dunlap
@ 2015-04-21 15:37     ` Stefano Stabellini
  0 siblings, 0 replies; 16+ messages in thread
From: Stefano Stabellini @ 2015-04-21 15:37 UTC (permalink / raw)
  To: George Dunlap; +Cc: xen-devel, george.dunlap, Stefano Stabellini

On Tue, 21 Apr 2015, George Dunlap wrote:
> On 04/21/2015 03:54 PM, Stefano Stabellini wrote:
> > A new utility function to make the code more readable and compact:
> > prints a message if VERBOSE = 1.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > ---
> >  lib/common-functions.sh |   46 ++++++++++++++++------------------------------
> >  1 file changed, 16 insertions(+), 30 deletions(-)
> > 
> > diff --git a/lib/common-functions.sh b/lib/common-functions.sh
> > index dc3a2bb..c19046b 100644
> > --- a/lib/common-functions.sh
> > +++ b/lib/common-functions.sh
> > @@ -1,5 +1,12 @@
> >  #!/usr/bin/env bash
> >  
> > +function _verbose_echo() {
> > +    if [[ $VERBOSE -eq 1 ]]
> > +    then
> > +        echo $*
> > +    fi
> > +}
> 
> Why _?  Don't we have VERBOSE in other parts of the code that could call
> this?

Yes, that is a good point, I'll change it.


> 
> > +
> >  # Executed once at the beginning of the script
> >  function common_init() {
> >      export BASEDIR=`pwd`
> > @@ -33,12 +40,9 @@ function common_init() {
> >      get_arch
> >      get_components
> >  
> > -    if [[ $VERBOSE -eq 1 ]]
> > -    then
> > -        echo "Distro: $DISTRO"
> > -        echo "Arch: $ARCH"
> > -        echo "Components: $COMPONENTS"
> > -    fi
> > +    _verbose_echo "Distro: $DISTRO"
> > +    _verbose_echo "Arch: $ARCH"
> > +    _verbose_echo "Components: $COMPONENTS"
> >  
> >      for f in $COMPONENTS
> >      do
> > @@ -62,10 +66,7 @@ function get_components() {
> >              if eval [[ ! -z \$"$capital"_REVISION ]]
> >              then
> >                  COMPONENTS="$COMPONENTS $component"
> > -                if [[ $VERBOSE -eq 1 ]]
> > -                then
> > -                    echo "Found component $component"
> > -                fi
> > +                _verbose_echo "Found component $component"
> >              fi
> >          done
> >      fi
> > @@ -166,10 +167,7 @@ function get_arch() {
> >  }
> >  
> >  function _check-package-deb() {
> > -    if [[ $VERBOSE -eq 1 ]]
> > -    then
> > -        echo "Checking for package ${args[0]}"
> > -    fi
> > +    _verbose_echo "Checking for package ${args[0]}"
> >  
> >      if dpkg -s "$1" 2>/dev/null | grep -q "Status:.*installed"
> >      then
> > @@ -184,10 +182,7 @@ function _install-package-deb() {
> >  }
> >  
> >  function _check-package-rpm() {
> > -    if [[ $VERBOSE -eq 1 ]]
> > -    then
> > -        echo "Checking for package $1"
> > -    fi
> > +    _verbose_echo "Checking for package $1"
> >  
> >      if rpm -q "$1" 2>&1 >/dev/null
> >      then
> > @@ -273,22 +268,13 @@ function for_each_component () {
> >          done
> >          if [[ $found -eq 0 ]]
> >          then
> > -            if [[ $VERBOSE -eq 1 ]]
> > -            then
> > -                echo "$component" is disabled
> > -            fi
> > +            _verbose_echo "$component" is disabled
> >              continue
> >          fi
> >  
> > -        if [[ $VERBOSE -eq 1 ]]
> > -        then
> > -            echo calling "$component"_"$1"
> > -        fi
> > +        _verbose_echo calling "$component"_"$1"
> >          "$component"_"$1"
> > -        if [[ $VERBOSE -eq 1 ]]
> > -        then
> > -            echo "$component"_"$1" done
> > -        fi
> > +        _verbose_echo "$component"_"$1" done
> >      done
> >  }
> >  
> > 
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/5] raisin: remove duplicate source config in raise
  2015-04-21 15:09   ` George Dunlap
@ 2015-04-21 15:42     ` Stefano Stabellini
  0 siblings, 0 replies; 16+ messages in thread
From: Stefano Stabellini @ 2015-04-21 15:42 UTC (permalink / raw)
  To: George Dunlap; +Cc: xen-devel, george.dunlap, Stefano Stabellini

On Tue, 21 Apr 2015, George Dunlap wrote:
> On 04/21/2015 03:55 PM, Stefano Stabellini wrote:
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> I take it this got here by a bad merge or somethign?

yes, I think it happened like that...

> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
> 
> > ---
> >  raise |   15 +++++----------
> >  1 file changed, 5 insertions(+), 10 deletions(-)
> > 
> > diff --git a/raise b/raise
> > index bce6908..68dbfd8 100755
> > --- a/raise
> > +++ b/raise
> > @@ -17,9 +17,12 @@ _help() {
> >  }
> >  
> >  # Include your defaults
> > -if [[ -e "./config" ]] ; then
> > -    . ./config
> > +if [[ ! -e "./config" ]]
> > +then
> > +   echo "No config file found, copying default config"
> > +   cp defconfig config
> >  fi
> > +source ./config
> >  
> >  # To use this as a library, set RAISIN_PATH appropriately
> >  [[ -z "$RAISIN_PATH" ]] && RAISIN_PATH="$PWD/lib"
> > @@ -29,14 +32,6 @@ source ${RAISIN_PATH}/common-functions.sh
> >  source ${RAISIN_PATH}/git-checkout.sh
> >  source ${RAISIN_PATH}/commands.sh
> >  
> > -# Include your defaults
> > -if [[ ! -e "./config" ]] ; then
> > -   echo "No config file found, copying default config"
> > -   cp defconfig config
> > -fi
> > -
> > -source ./config
> > -
> >  # Set up basic functionality
> >  common_init
> >  
> > 
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/5] raisin: introduce ovmf
  2015-04-21 15:03   ` George Dunlap
@ 2015-04-21 15:43     ` Stefano Stabellini
  2015-04-21 15:45       ` George Dunlap
  0 siblings, 1 reply; 16+ messages in thread
From: Stefano Stabellini @ 2015-04-21 15:43 UTC (permalink / raw)
  To: George Dunlap; +Cc: xen-devel, george.dunlap, Stefano Stabellini

On Tue, 21 Apr 2015, George Dunlap wrote:
> On 04/21/2015 03:55 PM, Stefano Stabellini wrote:
> > diff --git a/components/series b/components/series
> > index f0f3cfa..fe9092a 100644
> > --- a/components/series
> > +++ b/components/series
> > @@ -1,4 +1,5 @@
> >  seabios
> > +ovmf
> >  xen
> >  qemu
> >  qemu_traditional
> > diff --git a/components/xen b/components/xen
> > index b3426f0..b3a0c96 100644
> > --- a/components/xen
> > +++ b/components/xen
> > @@ -29,7 +29,8 @@ function xen_build() {
> >      cd xen-dir
> >      ./configure --prefix=$PREFIX --with-system-qemu=$PREFIX/lib/xen/bin/qemu-system-i386 \
> >          --disable-qemu-traditional --enable-rombios \
> > -        --with-system-seabios="$BASEDIR"/seabios-dir/out/bios.bin
> > +        --with-system-seabios="$BASEDIR"/seabios-dir/out/bios.bin \
> > +        --with-system-ovmf="$BASEDIR"/ovmf-dir/ovmf.bin
> 
> Does this still work if you don't build ovmf?

No, it doesn not and it is the same issue with seabios.
I should probably add a patch to check on components before adding these
command line options.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/5] raisin: introduce ovmf
  2015-04-21 15:43     ` Stefano Stabellini
@ 2015-04-21 15:45       ` George Dunlap
  2015-04-21 15:46         ` George Dunlap
  0 siblings, 1 reply; 16+ messages in thread
From: George Dunlap @ 2015-04-21 15:45 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel, george.dunlap

On 04/21/2015 04:43 PM, Stefano Stabellini wrote:
> On Tue, 21 Apr 2015, George Dunlap wrote:
>> On 04/21/2015 03:55 PM, Stefano Stabellini wrote:
>>> diff --git a/components/series b/components/series
>>> index f0f3cfa..fe9092a 100644
>>> --- a/components/series
>>> +++ b/components/series
>>> @@ -1,4 +1,5 @@
>>>  seabios
>>> +ovmf
>>>  xen
>>>  qemu
>>>  qemu_traditional
>>> diff --git a/components/xen b/components/xen
>>> index b3426f0..b3a0c96 100644
>>> --- a/components/xen
>>> +++ b/components/xen
>>> @@ -29,7 +29,8 @@ function xen_build() {
>>>      cd xen-dir
>>>      ./configure --prefix=$PREFIX --with-system-qemu=$PREFIX/lib/xen/bin/qemu-system-i386 \
>>>          --disable-qemu-traditional --enable-rombios \
>>> -        --with-system-seabios="$BASEDIR"/seabios-dir/out/bios.bin
>>> +        --with-system-seabios="$BASEDIR"/seabios-dir/out/bios.bin \
>>> +        --with-system-ovmf="$BASEDIR"/ovmf-dir/ovmf.bin
>>
>> Does this still work if you don't build ovmf?
> 
> No, it doesn not and it is the same issue with seabios.
> I should probably add a patch to check on components before adding these
> command line options.

Maybe you want to check the existence of the binary you're pointing to?
 That way if someone does 'COMPONENTS="xen" ./raise build', it won't
think that you've decided not to build ovmf (or seabios).

 -George

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/5] raisin: introduce ovmf
  2015-04-21 15:45       ` George Dunlap
@ 2015-04-21 15:46         ` George Dunlap
  0 siblings, 0 replies; 16+ messages in thread
From: George Dunlap @ 2015-04-21 15:46 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel, george.dunlap

On 04/21/2015 04:45 PM, George Dunlap wrote:
> On 04/21/2015 04:43 PM, Stefano Stabellini wrote:
>> On Tue, 21 Apr 2015, George Dunlap wrote:
>>> On 04/21/2015 03:55 PM, Stefano Stabellini wrote:
>>>> diff --git a/components/series b/components/series
>>>> index f0f3cfa..fe9092a 100644
>>>> --- a/components/series
>>>> +++ b/components/series
>>>> @@ -1,4 +1,5 @@
>>>>  seabios
>>>> +ovmf
>>>>  xen
>>>>  qemu
>>>>  qemu_traditional
>>>> diff --git a/components/xen b/components/xen
>>>> index b3426f0..b3a0c96 100644
>>>> --- a/components/xen
>>>> +++ b/components/xen
>>>> @@ -29,7 +29,8 @@ function xen_build() {
>>>>      cd xen-dir
>>>>      ./configure --prefix=$PREFIX --with-system-qemu=$PREFIX/lib/xen/bin/qemu-system-i386 \
>>>>          --disable-qemu-traditional --enable-rombios \
>>>> -        --with-system-seabios="$BASEDIR"/seabios-dir/out/bios.bin
>>>> +        --with-system-seabios="$BASEDIR"/seabios-dir/out/bios.bin \
>>>> +        --with-system-ovmf="$BASEDIR"/ovmf-dir/ovmf.bin
>>>
>>> Does this still work if you don't build ovmf?
>>
>> No, it doesn not and it is the same issue with seabios.
>> I should probably add a patch to check on components before adding these
>> command line options.
> 
> Maybe you want to check the existence of the binary you're pointing to?
>  That way if someone does 'COMPONENTS="xen" ./raise build', it won't
> think that you've decided not to build ovmf (or seabios).

Er, I mean, supposing you've *already* built ovmf, and you just want to
re-build Xen, it won't think you're trying to build without anything.

 -George

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-04-21 15:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-21 14:54 [PATCH 0/5] raisin: introduce ovmf and linux Stefano Stabellini
2015-04-21 14:54 ` [PATCH 1/5] raisin: introduce _verbose_echo Stefano Stabellini
2015-04-21 15:09   ` George Dunlap
2015-04-21 15:37     ` Stefano Stabellini
2015-04-21 14:55 ` [PATCH 2/5] raisin: remove duplicate source config in raise Stefano Stabellini
2015-04-21 15:09   ` George Dunlap
2015-04-21 15:42     ` Stefano Stabellini
2015-04-21 14:55 ` [PATCH 3/5] raisin: rename ARCH to RAISIN_ARCH Stefano Stabellini
2015-04-21 15:09   ` George Dunlap
2015-04-21 14:55 ` [PATCH 4/5] raisin: introduce ovmf Stefano Stabellini
2015-04-21 15:03   ` George Dunlap
2015-04-21 15:43     ` Stefano Stabellini
2015-04-21 15:45       ` George Dunlap
2015-04-21 15:46         ` George Dunlap
2015-04-21 14:55 ` [PATCH 5/5] raisin: build linux Stefano Stabellini
2015-04-21 15:11   ` George Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.