Code Monkey home page Code Monkey logo

arch_rpi_image_prepare's Introduction

Arch RPI Image Prepare

This repository contains tools to create a 4GB SD card image based upon latest arch sources including all dependencies for PirateBox.

Required Tools

To create an image you will need to have the following tools available on your system:

  • sudo environment
  • losetup from util-linux 2.2 (at least)
  • mkfs.vfat
  • mkfs.ext4
  • wget
  • fdisk
  • bc
  • qemu-system-arm
  • qemu-user-static (binfmt-support might be needed)
  • pv
  • zip

On Debian based systems simply run:

sudo apt-get install pv qemu-system-arm qemu-user-static zip

Build The RPi Image

Running make will acquire all dependencies, install PirateBox and package the image for distribution:

make

By default this target builds the image for the RPi 1 to build the image for RPi 2 simply pass the ARCH variable:

make ARCH=rpi2

There is a script in place that will build the images for RPi 1 and RPi 2, simply invoke:

./build_all.sh

The resulting zip files are stored in a freshly created folder "images".

Packaging the images

To zip the image simply invoke the dist target:

make dist

Versioning Scheme

The versioning scheme of the image is like so:

${sources}_${arch}_${version}-${buildnum}.img.zip

Each parameter is described below.

Available make Parameters

You can pass different parameters to the build script, lets describe them briefly.

ARCH

May be rpi or rpi2, defaults to rpi.

BUILD

Number of the build. Leave empty for a date stamp. Defaults to date stamp

VERSION

Used piratebox version in format x.y.z, defaults to devBuild

SOURCE

May be piratebox or librarybox, defaults to piratebox

BRANCH

The branch of pirtebox-ws used, defaults to master.

Accessing Image via chroot

To access the image via chroot simply mount the image by invoking

make mount_image

In case you need network access within the chroot mount proc to the mounted image:

sudo mount -t proc proc /mount/root/proc/

Then chroot into the environment:

sudo chroot /mount/root/

Do not forget to unmount the image when you are done:

make umount_image

Testing via Qemu

After the image is build it may be run in QEMU by invoking the helper script:

cd qemu-arm-rpi
./rpi.sh /path/to/piratebox.img

This only works with the RPi 1 image.

Dumping image to SD card

To dump the raw image to an SD card run:

sudo dd if=piratebox-rpi.img bs=2048 | pv | sudo dd of=/dev/mmcblk0 bs=2048
sync

Supported Platforms by image

There are only two images needed to support all different Raspberry Pi boards.

piratebox-rpi.img

  • Raspberry Pi 1 A
  • Raspberry Pi 1 A+
  • Raspberry Pi 1 B
  • Raspberry Pi 1 B+
  • Raspberry Pi Zero
  • Raspberry Pi Zero W

piratebox-rpi2.img

  • Raspberry Pi 2 B

Shout Outs

Big shout outs to all the people helping with testing (in alphabetical order):

arch_rpi_image_prepare's People

Contributors

bartschat avatar mastr avatar stylesuxx avatar

Watchers

 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.