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
    
  4. $ sudo qemu-debootstrap --arch armhf --variant=minbase jessie chroot-raspbian-armhf http://archive.raspbian.org/raspbian
    
  5. $ sudo mkdir chroot-raspbian-armhf/proc/ chroot-raspbian-armhf/sys/ chroot-raspbian-armhf/dev/
    
  6. 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
    
  7. Clone git repository.
    $ git clone https://github.com/raspberrypi/firmware.git
    
  8. Create directory.
    $ mkdir bootfs
    
  9. Create directories.
    $ sudo mkdir chroot-raspbian-armhf/lib chroot-raspbian-armhf/lib/modules
    
  10. 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/