Giter Site home page Giter Site logo

snappy's Introduction

Ubuntu Snappy Core for Gumstix

This repository provides tools to build Snappy Core images for Gumstix systems as well as Beagleboard and PandaBoard.

Snappy Core is under ongoing development and, as such, these images are meant only to provide a basis for experimentation and a starting point for Snappy + Gumstix. See Kudos and Caveats.

Prebuilt Images

Prebuilt images are available for Overo, DuoVero, Pepper, Beagle, and Panda. These images can be directly copied to a 4GB or greater microSD card. Warning: this erases anything currently on the microSD card! Note that any mounted partititions of the SD card should be unmounted before writing the image. These steps each take several minutes; your computer isn't hanging, the files are just large.

# substitute one of 'overo', 'duovero', 'pepper', 'beagle' or 'panda' in
# place of <machine>
$ wget http://gumstix-snappy.s3.amazonaws.com/<machine>.img.xz
$ xz -d <machine>.img.xz

# substitute the path to the drive e.g. /dev/sdd or /dev/mmcblk0 (not the
# path of a partition e.g. /dev/sdd1 or /dev/mmcblk0p1) in place of <drive>
# use 'udevadm monitor' when you insert the card to determine the path
$ sudo dd if=<machine>.img bs=4k of=<drive>
$ sync

After the process completes, plug the microSD card into your Gumstix (or TI) system, boot, login as ubuntu with password ubuntu and start playing with your shiny new Ubuntu Snappy Core!

By way of example, try installing the xkcd-webserver package so you can enjoy random XKCD comics delivered to your browser by your Snappy system:

# on your snappy system
$ sudo snappy install xkcd-webserver

On your development machine (on the same network as your snappy device), navigate to http://machine-name.local

An autobuilder generates weekly images for Overo, DuoVero, Pepper, Beagle, and Panda from the latest code. This is a good place to look to try out the latest features or access a particular older version.

Assemble Your Own Image

1. Grab some required software.

$ sudo apt-get install -y git build-essential make gcc-arm-linux-gnueabihf \
                          ubuntu-device-flash snappy-tools

2. (optional) Download an OEM Snappy package.

This package includes any components such as a bootloader that are specific to a particular device (i.e. Overo, DuoVero, [Pepper] pepper-snap, Beagle, and Panda).

$ wget http://gumstix-snappy.s3.amazonaws.com/<machine>.snap

As well as device-specific components, a system vendor could distribute a logo or pre-install other useful packages into any generated images. To make your own OEM package, see below.


Note:

As these OEM snaps are now available through the Snappy App Store, this step is optional. Just replace machine-name.snap with machine-name.gumstix in the --oem argument below and the OEM snap will be automatically fetched from the store.


3. Assembly a flashable image.

To support Snappy's rollback system, it has two OS partitions, system-a and system-b, both sized to be ~1GB as well as boot (system-boot) and user (writable) partitions; keep it roomy by creating a 4GB image. We'll use the 15.04 release and enable ssh as well developer-mode so we can install unsigned packages.

$ sudo ubuntu-device-flash core 15.04 -o <machine>.img --size 4 \
                                --oem <machine>.snap --developer-mode

Format a microSD as described above with the newly created img file. Once the card is created, take a look at the partition structure---there should be four as described above.

Technical Aside

There is unpartitioned space at the beginning of the card in which, on some installations, booloader components such as MLO and u-boot.img are written, rather than storing them on the system-boot partition. OMAP4 (DuoVero/Panda) and AM335x (Pepper) use this but, as OMAP3 (Overo/Beagle) u-boot would require a raw boot mode patch, we just place MLO and u-boot.img on the system-boot partition instead.


Note:

These steps were developed & tested on an Ubuntu 15.04 system. If you get errors about unknown arguments to ubuntu-device-flash, you probably have an older version. Grab the latest from the PPA:

$ sudo add-apt-repository ppa:snappy-dev/beta
$ sudo apt-get update
$ sudo apt-get install ubuntu-device-flash snappy-tools

Building From Scratch

The included Makefile should automate much of this process. Use the -j flag to specify the number of concurrent make processes.

$ make MACHINE=<machine> -j4

After some git-fetching and compiling, fresh binaries built from the newly checked out u-boot repository should be packaged up in a Snappy OEM package, machine-name.snap. The package build system for Snappy is pretty simple. Have a look at the package.yaml file in the machine's meta directory and then try building.

$ cd <machine>
$ snappy build
$ cp <machine>.snap ../
$ cd ..

If you make changes to any source files, just call make again to rebuild. We can also clean the build---we keep checked-out source around though.

$ make MACHINE=<machine> clean

Individual components can be also be (re-)built and cleaned e.g.

$ make MACHINE=overo uboot
$ make MACHINE=overo clean-uboot
$ make MACHINE=pepper oem
$ make MACHINE=pepper clean-oem

U-Boot

We grab the 2015.04 version of the u-boot bootloader from the Gumstix repository and store it in the u-boot directory.

$ git clone git://github.com/gumstix/u-boot.git -b v2015.04 u-boot

We then configure it using the machine-specific defconfig:

Machine Machine defconfig
overo omap3_overo_defconfig
duovero duovero_defconfig
pepper pepper_defconfig
beagle omap3_beagle_defconfig
panda omap4_panda_defconfig
$ cd u-boot
$ make CROSS_COMPILE=arm-linux-gnueabihf- <machine_defconfig>

Build and install the resulting MLO and u-boot.img files.

$ make CROSS_COMPILE=arm-linux-gnueabihf-
$ cp MLO u-boot.img ../<machine>/

Kudos and Caveats

In making this repository, there were many useful references. And of course, thanks to the good folks on the snappy-devel list :).

A few known issues:

  • There is a long (~15 second) pause after 'Starting Kernel...' as the ramdisk gets loaded. It is not frozen---just be patient.
  • Building the Snappy OEM package yields errors such as "(MANUAL REVIEW) type 'oem' not allowed". This is expected for OEM packages. The package will still be generated.

Currently, this is a yay-it-boots kinda thing; there is no customization of the filesystem, validation that all the hardware works, or any kernel config adjustments. If you find things that are broken or have suggestions, leave a comment, raise an issue, or best of all, send a pull request!

snappy's People

Contributors

ashcharles avatar

Stargazers

git.google.com avatar  avatar  avatar MURAT BOYAR avatar Rune Langøy avatar Trevor Joynson avatar Roger Barraud avatar Bruno Henrique de Castro avatar Gian James avatar Rafael Jesus avatar Guilherme Rezende avatar Hao Shi avatar Enrique Hernández Bello avatar LarreaMikel avatar Ryan Owens avatar Woodrow Shen avatar Gabriel Glachant avatar Anthony Wong avatar  avatar Ivan Zorin avatar François de Metz avatar  avatar

Watchers

 avatar James Cloos avatar Ryan Owens avatar Alex Lei avatar Woodrow Shen avatar  avatar  avatar

snappy's Issues

Failing to update due to too /boot/uboot/ being too small

ubuntu@panda:~$ sudo snappy update
Installing ubuntu-core (238)
Starting download of ubuntu-core
129.16 MB / 129.16 MB [================================================================================================================================================================================================================================================================================] 100.00 % 205.62 KB/s
Done
Failed to run command '/bin/cp /writable/cache/assets/initrd.img-3.19.0-66-generic /boot/uboot/b': /bin/cp: error writing ‘/boot/uboot/b/initrd.img-3.19.0-66-generic’: No space left on device
/bin/cp: failed to extend ‘/boot/uboot/b/initrd.img-3.19.0-66-generic’: No space left on device
(exit status 1)

Panda image has a public ssh key in authorized_keys

The panda image has this ~ubuntu/.ssh/authorized_keys:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC371laTSLCZlRZ1+eSsJYViE+cNsJlUwspdGFoKFlGBivUL+jisWHpe9a5MY1kLZPrYpRhCCE3jzimj0IWI0MDCJ2uXbgZkvzdwTXD5KFcUmjdN+5N4XY2a6TDoXo8sEpLdwmGnuiSnhtMKO58hzMJJ/HfB6jcUH37hfQ5FpU8byJ7YkX23d1wead7uT0uJnAtQQH2r3B1QS3BeO1MIO4FS6fmSzreT9+A4/pLB56HPLmFzuZBjGTZ/qHuJyoahp1+qk73kTzIzEZqwJzu4lx/QPJ2D8EsUWb2MhxQMMNl8yFjvkWZYr4/0o7sLd2YbZ6lhQcgKuYFxeLV0oBtvgV7 ash@gumstux

It should be removed.

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.