Skip to content

Instantly share code, notes, and snippets.

@sam-bristow
Created April 28, 2023 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sam-bristow/444417b6a9bbef74261abeecec9590af to your computer and use it in GitHub Desktop.
Save sam-bristow/444417b6a9bbef74261abeecec9590af to your computer and use it in GitHub Desktop.
Quickstart for Buildroot
#!/usr/bin/sh
log()
{
>&2 echo $@
}
# https://nightly.buildroot.org/manual.html#requirement-mandatory
PACKAGE_LIST="which sed make binutils diffutils gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc findutils wget"
dnf_install_packages()
{
log "Installing buildroot dependencies with dnf"
sudo dnf install $PACKAGE_LIST
}
apt_install_packages()
{
log "Installing buildroot dependencies with apt"
sudo apt install $PACKAGE_LIST build-essential
}
if [ $OSTYPE != "linux-gnu" ] ; then
log "Here's a nickle kid, go get yourself a better computer!"
exit 1
fi
if [ -f /etc/redhat-release ] ; then
log "Detected Red Hat / Fedora family"
dnf_install_packages
elif [ -f /etc/debian_version ] ; then
log "Detected Debian / Ubuntu family"
apt_install_packages
else
log "Unsupported distro"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment