Created
April 28, 2023 11:03
-
-
Save sam-bristow/444417b6a9bbef74261abeecec9590af to your computer and use it in GitHub Desktop.
Quickstart for Buildroot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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