Skip to content

Instantly share code, notes, and snippets.

@peterleif
Created April 13, 2017 08:32

Revisions

  1. peterleif created this gist Apr 13, 2017.
    51 changes: 51 additions & 0 deletions yocto-setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@
    #!/bin/bash

    # Locale settings to support UTF-8
    locale-gen en_US.UTF-8
    echo 'export LANG=en_US.UTF-8' >> .bashrc
    echo 'export LANGUAGE=en_US:en' >> .bashrc
    echo 'export LC_ALL=en_US.UTF-8' >> .bashrc

    # Add the 32-bit arch for compat libraries
    dpkg --add-architecture i386

    apt update && apt --quiet --yes upgrade

    # To remove the error : https://github.com/phusion/baseimage-docker/issues/319
    apt --quiet --yes install apt-utils

    # Yocto's depends (plus sudo)
    apt --quiet --yes install gawk wget git-core diffstat unzip \
    texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev \
    python sudo curl libssl-dev

    # If you need to add more packages, just do additional commands here
    # I've intentionally done this so that the layers before this don't have
    # to be regenerated and fetched since the above layer is big.
    # apt --quiet --yes install something
    apt --quiet --yes install tmux libncurses5-dev

    # Add some debug utilities
    apt --quiet --yes install strace ltrace

    # Add more items for REALLY OLD yocto builds
    apt --quiet --yes install libsdl1.2-dev chrpath

    # Add a couple of items to generate documentation
    apt --quiet --yes install groff ghostscript txt2man

    # Someone needs 32-bit binaries (I'm looking at you node)
    apt --quiet --yes install libstdc++6:i386

    # Required to generate kernel image
    apt --quiet --yes install cpio

    # Want some text editor other than vim
    apt --quiet --yes install emacs

    # Add "repo" tool (used by many Yocto-based projects)
    curl http://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo
    chmod a+x /usr/local/bin/repo

    # Set the default shell to bash instead of dash
    echo "dash dash/sh boolean false" | debconf-set-selections && dpkg-reconfigure dash