Added script and firmware files
This commit is contained in:
parent
2a9eb5f035
commit
3ead3cc338
13
README.md
13
README.md
|
@ -0,0 +1,13 @@
|
|||
### LibreSDR B210 Mini Firmware and documentation
|
||||
|
||||
## Getting started
|
||||
# Requirements:
|
||||
-
|
||||
- This repo with install.sh: ensures all proper libraries at least on Fedora and Ubuntu.
|
||||
|
||||
|
||||
|
||||
## Locations:
|
||||
|
||||
- /usr/lib/ettus/ - Firmware location
|
||||
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -0,0 +1,56 @@
|
|||
#!/bin/bash
|
||||
# Names of packages under different distros
|
||||
PACKAGES_DEBIAN="uhd-host libuhd* uhd-soapysdr"
|
||||
PACKAGES_RHEL="uhd-tools uhd-devel uhd soapy-uhd"
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "Error: This script must be run as root. Exiting." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Function to determine the Linux distribution
|
||||
detect_distro() {
|
||||
if [[ -f /etc/os-release ]]; then
|
||||
. /etc/os-release
|
||||
DISTRO_ID=$ID
|
||||
elif command -v lsb_release >/dev/null 2>&1; then
|
||||
DISTRO_ID=$(lsb_release -si | tr '[:upper:]' '[:lower:]')
|
||||
elif [[ -f /etc/debian_version ]]; then
|
||||
DISTRO_ID="debian"
|
||||
elif [[ -f /etc/fedora-release ]]; then
|
||||
DISTRO_ID="fedora"
|
||||
else
|
||||
DISTRO_ID="unknown"
|
||||
fi
|
||||
|
||||
echo "$DISTRO_ID"
|
||||
}
|
||||
|
||||
|
||||
# Check distro version to install correct packages
|
||||
DISTRO_ID=$(detect_distro)
|
||||
case "$DISTRO_ID" in
|
||||
debian|ubuntu|pop|linuxmint|elementary)
|
||||
apt install -y $PACKAGES_DEBIAN
|
||||
;;
|
||||
|
||||
fedora|rhel|centos)
|
||||
yum install -y $PACKAGES_RHEL
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 1
|
||||
|
||||
# Ensuring Environment variables
|
||||
#export UHD_IMAGES_DIR=/usr/lib/ettus/ # User specific alternative
|
||||
echo "UHD_IMAGES_DIR=/usr/lib/ettus/" >> /etc/environment # Ensure env across multiple installs on multiple users.
|
||||
source /etc/environment
|
||||
|
||||
|
||||
# Copying Firmware files
|
||||
mkdir /usr/lib/ettus/ # Create the library folder
|
||||
cp -r ./firmware/* /usr/lib/ettus/ # Copy firmware files
|
||||
chown -r root:root /usr/lib/ettus/ # Ensure root owns the files
|
||||
chmod -r 776 /usr/lib/ettus/ # This makes only root able to change the folder and file content
|
||||
|
||||
uhd_image_loader --download --args type=b200
|
Loading…
Reference in New Issue