Giter VIP home page Giter VIP logo

build-raspbian-image's Introduction

BuildRaspbianImage

Build (and cross-compile) your own image for Raspberry Pi

Set of bash scripts for your Debian or Ubuntu Linux to create your own .img file for Raspberry Pi. Have your own image with YOUR content in minutes!

Initial script was taken from the [Klaus Maria Pfeiffer blog] (http://blog.kmp.or.at/2012/05/build-your-own-raspberry-pi-image/).

About initial code

Original script was created to burn Debian Wheezy, my target is Raspbian, which is better for Raspberry Pi. You can read more about Raspbian (and its difference from stock Debian) at project page: http://raspbian.org

Milestones of this project

  • Add script to create minimal Raspbian image
  • Add image mount / unmount script with cross-compilation environment for mounted system
  • Be able to deploy images (add individual hostname and root password, OpenVPN client settings)

Instructions

It is possible to prepare environment on almost every Linux, where chroot, QEMU and debootstrap exists. I strictly recommend to install apt-cacher-ng (apt-get install apt-cacher-ng), that caches all downloaded deb packages and lets you to use deb_local_mirror, what's extreamely useful for further experiments, system won't download packages from internet anymore! [Read more about apt-cacher-ng] (https://www.unix-ag.uni-kl.de/~bloch/acng/html/config-servquick.html#config-client)

Install minimal set of packages: ./install.sh

Run build_raspbian_sd_card.sh script, do burn your SD card

./build_raspbian_sd_card.sh /dev/sdX

OR to create IMG file (you'll find it under /tmp/rpi folder)

./build_raspbian_sd_card.sh

build-raspbian-image's People

Contributors

andrius avatar icancode23 avatar markvdb avatar stefanscherer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

build-raspbian-image's Issues

init rootfs (debootstrap) not working in raspbian script

debootstrap --foreign --arch armhf ${deb_release} ${rootfs} ${deb_local_mirror} does not work in Raspbian build script. Changing deb_mirror to an official Debian mirror while leaving the rest of the script untouched works.

Maybe there are some packages missing in the Raspbian repository which are necessary for creating the root filesystem.

Minimal image

Could we use this script in order to build minimal raspbian edition. (server edition like)

Ubuntu 16.04 support

The script seems not to work in ubuntu 16.04 it gives this error

`sudo ./build_raspbian_sd_card.sh
no block device given, just creating an image
3800+0 records in
3800+0 records out
3800000000 bytes (3.8 GB, 3.5 GiB) copied, 54.2209 s, 70.1 MB/s
image /home/fcon/Gits/build-raspbian-image/rpi/images/raspbian_basic_wheezy_20160916.img created and mounted as /dev/loop6

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognised partition table.
Created a new DOS disklabel with disk identifier 0x4b0b0740.

Command (m for help): Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-7421874, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-7421874, default 7421874):
Created a new partition 1 of type 'Linux' and of size 64 MiB.

Command (m for help): Selected partition 1
Partition type (type L to list all types): Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Command (m for help): Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (133120-7421874, default 133120): Last sector, +sectors or +size{K,M,G,T,P} (133120-7421874, default 7421874):
Created a new partition 2 of type 'Linux' and of size 3.5 GiB.

Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Invalid argument

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

mkfs.fat 3.0.28 (2015-05-16)
/dev/mapper/loop6p1: No such file or directory
mke2fs 1.42.13 (17-May-2015)
The file /dev/mapper/loop6p2 does not exist and no size was specified.
mount: special device /dev/mapper/loop6p2 does not exist
/usr/sbin/debootstrap: 1368: /usr/sbin/debootstrap: cannot create /home/fcon/Gits/build-raspbian-image/rpi/rootfs/test-dev-null: Permission denied
E: Cannot install into target '/home/fcon/Gits/build-raspbian-image/rpi/rootfs' mounted with noexec or nodev
cp: cannot create regular file 'usr/bin/': Not a directory
chroot: failed to run command '/debootstrap/debootstrap': No such file or directory
mount: mount point /home/fcon/Gits/build-raspbian-image/rpi/rootfs/boot does not exist
./build_raspbian_sd_card.sh: line 178: etc/apt/sources.list: No such file or directory
./build_raspbian_sd_card.sh: line 180: boot/cmdline.txt: No such file or directory
./build_raspbian_sd_card.sh: line 184: etc/fstab: No such file or directory
./build_raspbian_sd_card.sh: line 186: etc/hostname: No such file or directory
./build_raspbian_sd_card.sh: line 193: etc/network/interfaces: No such file or directory
./build_raspbian_sd_card.sh: line 197: etc/modules: No such file or directory
chroot: failed to run command '/third-stage': No such file or directory
./build_raspbian_sd_card.sh: line 232: etc/apt/sources.list: No such file or directory
chroot: failed to run command '/cleanup': No such file or directory
umount: /dev/mapper/loop6p1: not mounted
umount: /home/fcon/Gits/build-raspbian-image/rpi/rootfs: not mounted
umount: /dev/mapper/loop6p2: not mounted
finishing /home/fcon/Gits/build-raspbian-image/rpi/images/raspbian_basic_wheezy_20160916.img
loop deleted : /dev/loop6
created image /home/fcon/Gits/build-raspbian-image/rpi/images/raspbian_basic_wheezy_20160916.img
done.
`

Tested in vm whit 14.04 seems to work fine.

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.