GithubHelp home page GithubHelp logo

djs55 / xen-arm-builder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mirage/xen-arm-builder

0.0 3.0 0.0 281 KB

Build an SDcard image for Xen/ARM, for a Cubieboard

Shell 89.93% Makefile 10.07%

xen-arm-builder's Introduction

The scripts in this repository provide an easy way to set up Xen on a Cubieboard 2 or CubieTruck with:

  • U-Boot as the bootloader,
  • Xen as the hypervisor,
  • Ubuntu Trusty as dom0, and
  • LVM managing guest disks.

Pre-built binaries

To save time and the need to install Ubuntu, you can download pre-built SDcard images from here:

Building from source

These scripts must be run on Ubuntu or Debian (they install some packages using apt-get).

  1. Select your board (cubieboard2 or cubietruck):

      $ export BOARD=cubieboard2
    
  2. On Debian, follow the sunxi toolchain instructions to install the emdebian-archive-keyring package and the emdebian.org apt source.

  3. Download the dependencies (this will clone all the relevant repositories):

      $ make clone
    
  4. On Debian, symlink the GCC 4.7 cross-compilers into your $PATH as described on the sunxi site.

  5. Build U-Boot, Xen and Linux:

      $ make build
    

    You may get prompted about extra configuration options at this point. You can probably just press Return to accept the default for each one.

  6. Build the SDcard image:

      $ make $BOARD.img
    

    It will need to mount various loopback devices on /mnt during this process.

Installation

Linux

  1. Copy the BOARD.img to the SDcard, e.g.

     $ dd if=cubieboard2.img of=/dev/mmcblk0
    

OS X

  1. Find the disk device of the card you inserted:

     sudo diskutil list
    

    (e.g. disk2)

  2. Unmount the disk images:

     sudo diskutil unmountDisk /dev/diskN
    
  3. Copy the image:

     sudo dd if=cubieboard2.img of=/dev/rdiskN bs=64k
    

    Note: Without the 'rdisk' in the output file, the copying will be extremely slow due to buffering.

Booting

Insert the SDcard in the device, then connect the network and power. The device should get an IP address using DHCP. SSH to the device (the name is $BOARD.local., which can be used if your machine supports mDNS/avahi/zeroconf):

The password is mirage.

Install your SSH public key and change login password (or lock the account with sudo passwd -l mirage).

If you plan on connecting to TLS-secured services, don't forget to set the system time so that certificate validity windows work correctly (not many TLS certificates were valid in 1970).

Using Xen

You should now be able to use Xen via the xl command:

$ sudo xl list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0   512     2     r-----     171.7

Installing libvirt w/Xen support

The libvirt-package in Ubuntu does not have Xen support enabled by default. To download and install libvirt automatically, run sudo /root/scripts/install_libvirt.sh. This script compiles libvirt with Xen support and configures libvirtd to listen to a Unix socket. If you need access to libvirtd over TCP, further instructions are available here.

Adding device drivers

To add drivers to the supplied Linux kernel, first clone and install the default configuration:

$ make clone

After cloning, the Linux kernel is in a folder called 'linux' and the default configuration file from the 'config/' folder has been copied to 'linux/.config'.

You can now configure the kernel, for example by using menuconfig:

$ cd linux
$ make clean
$ make menuconfig

When you are happy with the configuration you may copy 'linux/.config' back to 'config/' to make sure that it is not overwritten later by 'make clone'.

If the drivers you have enabled need binary firmware, add the name of the firmware file (or folder) to the FIRMWARE-variable in the Makefile. Alternatively, you can set the FIRMWARE environment variable before calling 'make':

$ export FIRMWARE=rtlwifi

The specified firmware will be copied from 'linux-firmware/' to '/lib/firmware' on the final image.

You should now be able to build the new image with the updated kernel and firmware with "make build" and "make $BOARD.img".

xen-arm-builder's People

Contributors

avsm avatar chris00 avatar dsheets avatar heidihoward avatar jonludlam avatar magnuss avatar samoht avatar talex5 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.