Skip to content

Raspbian Custom Operating System Build

Raspbian is a Debian based operating system for the Raspberry Pi.

Build Instructions

The instructions will produce a bare minimal operating system.

Note

It is assumed a Debian based operating system is being used to preform the build and to be done via the shell or terminal.

  1. Install the following packages.
    $ sudo apt-get install binfmt-support debootstrap kpartx qemu qemu-user-static
    
  2. Create directory.
    $ mkdir -p ~/raspbianos
    
  3. Change directory.
    $ cd ~/raspbianos
    
    1.
    $ sudo qemu-debootstrap --arch armhf --variant=minbase jessie chroot-raspbian-armhf http://archive.raspbian.org/raspbian
    
    1.
    $ sudo mkdir chroot-raspbian-armhf/proc/ chroot-raspbian-armhf/sys/ chroot-raspbian-armhf/dev/
    
  4. Mount.
    $ sudo mount -t proc proc ~/raspberry.tips/chroot-raspbian-armhf/proc
    $ sudo mount -t sysfs sysfs ~/raspberry.tips/chroot-raspbian-armhf/sys
    $ sudo mount -o bind /dev ~/raspberry.tips/chroot-raspbian-armhf/dev
    
  5. Clone git repository.
    $ git clone https://github.com/raspberrypi/firmware.git
    
  6. Create directory.
    $ mkdir bootfs
    
  7. Create directories.
    $ sudo mkdir chroot-raspbian-armhf/lib chroot-raspbian-armhf/lib/modules
    
  8. Copy files.
    $ sudo cp -R firmware/hardfp/opt/* chroot-raspbian-armhf/opt/
    $ sudo cp -R firmware/modules/* chroot-raspbian-armhf/lib/modules/
    $ sudo cp -R firmware/boot/* bootfs/