Alpha release of check-requirements.sh

A script to install the required packages for Yocto Project (as listed here) for whatever your distro happens to be. It autodetects your Linux distribution and does the Right Thing (tm).

This script isn't specific to Yocto Project nor OpenEmebedded and could trivially be adapted to other projects. It is based on code from ready-for.sh (which the primary author also wrote)

This script also includes an auto-updater (when new versions are published here) and can output a JSON file with all the same requirement info contained.


Download check-requirements.sh

$ chmod 755 check-requirements.sh
$ ./check-requirements.sh --help
Usage: check-requirements.sh [options] [requirement-list]
      --distro               List current Linux distro
  -i  --install              Install missing packages
      --json                 Generate JSON file of all requirements
  -l  --list                 List all supported requirements lists
      --list-requirements    List requirements for all Linux distros
  -r  --remove [--all]       Remove installed packages
      --no-cache             Don't use previously cached output.
  -I  --no-install           Don't check installed packages
      --no-network           Disable network check (for testing purposes)
  -R  --no-recommends        Don't install recommended packages
  -S  --no-suggests          Don't install suggested packages
      --update               Update to latest version of this script
      --verify               Verify script MD5sum against upstream
  -V  --version              List script version
  -v  --verbose              Turn on extra messages
  -y  --yes                  Answer 'yes' to every question

Example: check-requirements.sh --list
         check-requirements.sh YP
         check-requirements.sh --install YP

$ ./check-requirements.sh --list
Available (7) options:
  BR - Requirements for BuildRoot
  CALE - Requirements for C-ALE
  EALE - Requirements for E-ALE
  YP - Requirements for Yocto Project
  YPDOC - Requirements for Yocto Project Documentation
  YPGUI - Requirements for Yocto Project GUI
  YPST - Requirements for OpenEmbedded Self-Test

$ ./check-requirements.sh YP
Checking that this computer is suitable for YP: Requirements for Yocto Project
--------------------------------------------------------------------------------
PASS: CPU architecture is x86_64
...
PASS: Internet is available (which is required in this case)
--------------------------------------------------------------------------------
WARN: Some packages are missing
NOTE: Need to install: build-essential bzip2 ccache chrpath cpio debianutils
default-jre diffstat diffutils file findutils gawk gcc-multilib git gzip
iputils-ping libglib2.0-dev libxml2-utils make patch python python3
python3-pexpect python3-pip socat tar texinfo unzip wget xz-utils
You can install missing packages by running:
  ./check-requirements.sh --install YP
or by:
  sudo apt-get --no-install-recommends install build-essential bzip2 ccache
chrpath cpio debianutils default-jre diffstat diffutils file findutils gawk
gcc-multilib git gzip iputils-ping libglib2.0-dev libxml2-utils make patch
python python3 python3-pexpect python3-pip socat tar texinfo unzip wget
xz-utils
--------------------------------------------------------------------------------
WARN: Your computer doesn't meet the stated requirements

$ ./check-requirements.sh --install YP
...
--------------------------------------------------------------------------------
WARN: Some packages are missing
WARN: About to install: build-essential bzip2 ccache chrpath cpio debianutils
default-jre diffstat diffutils file findutils gawk gcc-multilib git gzip
iputils-ping libglib2.0-dev libxml2-utils make patch python python3
python3-pexpect python3-pip socat tar texinfo unzip wget xz-utils 
Is that okay? [y/N] 

If a new version is uploaded here, the next time you run the script it will prompt you to upgrade.

$ ./check-requirements.sh
NOTE: A new version of this script was found. (use "./check-requirements.sh --update" to download)
Usage: check-requirements.sh [options] [requirements-list]
...

$ ./check-requirements.sh --update
INFO: Checking for updated script
NOTE: A new version of this script was found. Upgrading...

$ ./check-requirements.sh --verify
PASS: md5sum matches