From patchwork Sun Aug 27 03:01:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajiv Ranganath X-Patchwork-Id: 9923665 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 83F1E60380 for ; Sun, 27 Aug 2017 03:04:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54BE31FFAD for ; Sun, 27 Aug 2017 03:04:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46EDC2858F; Sun, 27 Aug 2017 03:04:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 820F628583 for ; Sun, 27 Aug 2017 03:04:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlnpg-0005io-UW; Sun, 27 Aug 2017 03:01:52 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlnpf-0005i6-O1 for xen-devel@lists.xen.org; Sun, 27 Aug 2017 03:01:51 +0000 Received: from [85.158.143.35] by server-11.bemta-6.messagelabs.com id 69/68-03612-F1632A95; Sun, 27 Aug 2017 03:01:51 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHIsWRWlGSWpSXmKPExsVyMfTASl05s0W RBrunsFss+biYxYHR4+ju30wBjFGsmXlJ+RUJrBl9q/YxFXzSqHhx7RBbA+MC5S5GLg4hgYmM Eitm7WMBcVgE9rFKfNp+nRHEkRA4yCox7dcBti5GTiAnTWL+nLfMEHa5xJkZ/8DiQgJaEo0LD rJBjPrGKHHv9w9WkASbgLHEkkOPwYpEBKQlrn2+DDSVg4NZQEri9EFzkLCwgKdE/4OTTCA2i4 CqxMlD28Dm8wq4Szy5fZkFYpecRMP5+2BxTgEPie0vXrJC7HWX+PR1PVivKFDNysstrBC9ghI nZz5hgVilKbF+lz5ImFlAXmL72znMExhFZiGpmoVQNQtJ1QJG5lWMGsWpRWWpRbqGpnpJRZnp GSW5iZk5uoYGZnq5qcXFiempOYlJxXrJ+bmbGIHhzwAEOxi/LQs4xCjJwaQkyuugsTBSiC8pP 6UyI7E4I76oNCe1+BCjDAeHkgQvv8miSCHBotT01Iq0zBxgJMKkJTh4lER4K0HSvMUFibnFme kQqVOMlhxXrqz7wsSxYfV6IDnlwPYvTEIsefl5qVLivKKmQA0CIA0ZpXlw42DJ4hKjrJQwLyP QgUI8BalFuZklqPKvGMU5GJWEeXlBpvBk5pXAbX0FdBAT0EGKggtBDipJREhJNTBmlt35Imbh O/Nk99kDSlHXLsl0vXvRoHty3pJ7LE1Of+O7E+6G7b3DziO9dcIXnv/ZHz+x7p5z9eqWvn+Ty h6nN0qcv5g51WbrWx4GdYm8a1W76tdKfrdI/1X/eUpOyXpLo1shfbs0jKdoyrnd2BaT4vrI+J rGrws7vb4w2imcf9CrPvFnkO0hJZbijERDLeai4kQAP+V8/REDAAA= X-Env-Sender: rajiv.ranganath@atihita.com X-Msg-Ref: server-14.tower-21.messagelabs.com!1503802908!73081282!1 X-Originating-IP: [209.85.192.169] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5140 invoked from network); 27 Aug 2017 03:01:49 -0000 Received: from mail-pf0-f169.google.com (HELO mail-pf0-f169.google.com) (209.85.192.169) by server-14.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 27 Aug 2017 03:01:49 -0000 Received: by mail-pf0-f169.google.com with SMTP id r62so6310705pfj.0 for ; Sat, 26 Aug 2017 20:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atihita-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=h6+DIAIcfoNBpfBApBCRrR6ReetYHMIXzOX8VqirAa8=; b=dU4dnOaT+DKJarrAAgErcE0hwDjYy077s0c4HojNgW63EmEuxhRiS703QtQ4mqyCtR tqbbXQqBAZW1LKtNakiGhcFoV57CJewzEvKyBbA7j/6zi7UUo4p2FopHWGKoBo1vioOH xg54koL8X8zR3rTt3Tv1+OvtBeys+5JisUfPwNDx/QQJ3XjnPmM5WfwxUwceJMY9eYfw 0KIo/VptDl8iXkCyj35WX1q1Kzhya4knmlQdwcUttyDX1btWNU7TFF1xuMTORKw1+cnI qcglrZtPcFHWRIrU4LlB93d0Y2asceKYdvi0ItQx9GcBepr2UuTuY7qWQQPp+6QFKS2d s14Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=h6+DIAIcfoNBpfBApBCRrR6ReetYHMIXzOX8VqirAa8=; b=ADDeONuCmRbTB2KVp9XjwFokpDYV4g7fr0a9ndiwTpwW6/LweAEDqjMWhAv8uOMMfF dsy0oh69VaTQlpxMgiMiNH887Zn7f9NYPqA8RwekniDvCYCEyK81SDe9CF+yBjG854GG soW0QWIctIGMndUIPdUywu3F9nb0BCBXp34x6BPo4MOAstwros0apfAJRoCucSxG0gEQ p1kZbRyhawIl3gQgVhitlvEKDMuwb6Zwm5zQWkw4SnQ+/oWxYacu4cAjwWGFIbbDjHXq VKJVmf0wcrEO+FP/L1msVQt5uca/Uik8StndHNLrwv75AZLSNjZWVW7ufv0K4Cau6a/l 3Y4w== X-Gm-Message-State: AHYfb5iHrQsFMMAl4wgI938nTqYmG77gJCU9+h5oxg4mlu68ZpBOjT26 Fj2rW47BAPSrN6s+Ya40+g== X-Received: by 10.98.80.69 with SMTP id e66mr3232566pfb.60.1503802907911; Sat, 26 Aug 2017 20:01:47 -0700 (PDT) Received: from localhost ([103.205.218.127]) by smtp.gmail.com with ESMTPSA id b29sm20927804pfh.22.2017.08.26.20.01.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Aug 2017 20:01:47 -0700 (PDT) From: Rajiv Ranganath To: xen-devel@lists.xen.org Date: Sun, 27 Aug 2017 08:31:45 +0530 Message-Id: <20170827030145.40527.96512.stgit@rajivs-macbook-pro.local> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170827030018.40527.88922.stgit@rajivs-macbook-pro.local> References: <20170827030018.40527.88922.stgit@rajivs-macbook-pro.local> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: sstabellini@kernel.org Subject: [Xen-devel] [stage1-xen PATCH v1 10/10] BUILDING.md: Add Fedora instructions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Rajiv Ranganath Reviewed-by: Stefano Stabellini --- BUILDING.md | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 91 insertions(+), 5 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 3ef5311..946c799 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,7 +1,13 @@ # Build -stage1-xen requires new Xen and QEMU versions at the time of writing. You are unlikely to find them already packaged with your distro. This document describes how to build and install the latest Xen and QEMU from scratch. In addition, given that CoreOS rkt is also missing from reasonably new distros such as Ubuntu Xenial Xerus, I added instructions on how to build that too. The document includes the dependencies needed for the build based on Ubuntu Xenial Xerus. +stage1-xen requires new Xen and QEMU versions at the time of writing. You are unlikely to find them already packaged with your distro. This document describes how to build and install the latest Xen, QEMU and rkt from scratch for Ubuntu Xenial Xerus and Fedora. Differently from documentation for Ubuntu, the documentation for Fedora uses a Docker container for the build. There is also support for building on host on Fedora. -## Building Xen + * [Ubuntu Xenial Xerus](#build_ubuntu) + * [Fedora](#build_fedora) + + +## Ubuntu Xenial Xerus + +### Building Xen ``` apt-get install git build-essential python-dev gettext uuid-dev libncurses5-dev libyajl-dev libaio-dev pkg-config libglib2.0-dev libssl-dev libpixman-1-dev bridge-utils wget libfdt-dev bin86 bcc liblzma-dev iasl libc6-dev-i386 @@ -17,7 +23,7 @@ reboot Make sure to select Xen at boot, or edit /boot/grub/grub.cfg to make it the default, changing "set default="0" to point to the appropriate entry below (the one booting xen.gz), which could be entry number "4" for example. -## Building QEMU +### Building QEMU ``` apt-get install libglib2.0-dev libpixman-1-dev libcap-dev libattr1-dev @@ -54,7 +60,7 @@ make install cp i386-softmmu/qemu-system-i386 /usr/lib/xen/bin/ ``` -## Building CoreOS rkt +### Building CoreOS rkt ``` apt-get install golang automake libacl1-dev libsystemd-dev ./configure --disable-tpm --with-stage1-flavors=coreos @@ -62,7 +68,7 @@ make cp build-rkt-1.26.0+git/target/bin/rkt /usr/sbin ``` -## Building stage1-xen +### Building stage1-xen ``` apt-get install busybox-static jq @@ -72,3 +78,83 @@ export GOPATH=/path/to/gopath bash build.sh cp stage1-xen.aci /home/username ``` + + +## Fedora + +On Fedora there are two ways to build stage1-xen artifacts. + + * [Container Build](#build_fedora_container_build) + * [Manual Build](#build_fedora_manual_build) + + +### Container Build + +We can build stage1-xen artifacts (Xen, QEMU and rkt) automatically in a docker container as follows – + +``` +cd stage1-xen + +docker pull lambdalinuxfedora/stage1-xen-fedora-buildroot + +docker run --rm \ + -v `pwd`:/root/gopath/src/github.com/rkt/stage1-xen \ + -v /tmp:/tmp \ + -t -i lambdalinuxfedora/stage1-xen-fedora-buildroot \ + /sbin/my_init -- /root/bin/run +``` + +Once `docker run` completes, the build artifact `stage1-xen-build.tar.gz` is generated in `/tmp` directory. Please see [RUNNING_STAGE1_XEN.md](build/fedora/RUNNING_STAGE1_XEN.md) for details on how to setup Fedora for running stage1-xen. + + +### Manual Build + +It is also possible to manually build stage1-xen components on a Fedora host. + +Please ensure that you have all the dependencies installed. The dependencies for Xen, QEMU, rkt and stage1-xen is documented in [buildroot-Dockerfile](build/fedora/buildroot-Dockerfile). You will also need to install [`binutils`](https://github.com/lambda-linux-fedora/binutils) package that is compiled with `i386pe` support. You can download the pre-built RPMs from [here](https://drive.google.com/open?id=0B_tTbuxmuRzIR05wQ3E1eWVyaGs). + +Install `binutils` package. + +``` +tar xvf binutils-2.26.1-1.1.fc25.tar + +dnf install -y ./binutils/2.26.1/1.1.fc25/x86_64/binutils-2.26.1-1.1.fc25.x86_64.rpm +``` + +You can verify `i386pe` support in `binutils` by doing the following. + +``` +[root@localhost]# ld -V +GNU ld version 2.26.1-1.1.fc25 Supported emulations: + elf_x86_64 + elf32_x86_64 + elf_i386 + elf_iamcu + i386linux + elf_l1om + elf_k1om + i386pep + i386pe +``` + +You should see the lines `i386pep` and `i386pe` in the output. + +Next you can build Xen, Qemu and rkt using the following scripts – + + * [`build/fedora/components/xen`](build/fedora/components/xen) + * [`build/fedora/components/qemu`](build/fedora/components/qemu) + * [`build/fedora/components/rkt`](build/fedora/components/rkt) + +Please review the scripts and adjust the paths according to your requirements. + +Once the dependencies are installed, you can build stage1-xen + +``` +git clone https://github.com/rkt/stage1-xen.git +cd stage1-xen +export GOPATH=/path/to/gopath +bash build.sh +cp stage1-xen.aci /home/username +``` + +Please see [RUNNING_STAGE1_XEN.md](build/fedora/RUNNING_STAGE1_XEN.md) for details on how to run rkt with stage1-xen.