Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save birgersp/299ea9e6b51be70486d85f29ce3482f4 to your computer and use it in GitHub Desktop.
Save birgersp/299ea9e6b51be70486d85f29ce3482f4 to your computer and use it in GitHub Desktop.

Revisions

  1. birgersp renamed this gist Sep 2, 2019. 1 changed file with 0 additions and 0 deletions.
  2. birgersp created this gist Sep 2, 2019.
    25 changes: 25 additions & 0 deletions Setup Raspberry Pi chroot, for cross compilation
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    #!/bin/bash

    # https://gauvain.pocentek.net/docs/raspbian-chroot/

    apt install schroot

    echo \
    [jessie] \
    description=Raspbian armhf \
    directory=/var/chroot \
    users=$USER \
    groups=sbuild \
    root-groups=root >> /etc/schroot/schroot.conf

    apt install qemu-user-static debootstrap
    CHROOT=/var/chroot
    debootstrap --no-check-gpg --foreign --arch=armhf jessie $CHROOT http://archive.raspbian.org/raspbian
    cp /usr/bin/qemu-arm-static $CHROOT/usr/bin
    chroot $CHROOT /debootstrap/debootstrap --second-stage
    cat > $CHROOT/etc/apt/sources.list << EOF
    deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
    deb http://archive.raspberrypi.org/debian/ jessie main
    EOF
    chroot $CHROOT apt-key adv --keyserver keyserver.ubuntu.com --recv 82B129927FA3303E
    chroot $CHROOT apt-get update