Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small tidyups #40

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions rpi-update
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ else
fi

ROOT_PATH=${ROOT_PATH:-"/"}
if command -v vcgencmd > /dev/null; then
if command -v vcgencmd > /dev/null 2>&1; then
CUR_FW_SUBDIR="/$(echo =$(vcgencmd get_config os_prefix) | cut -d'=' -f3)"
else
CUR_FW_SUBDIR="/"
Expand Down Expand Up @@ -76,7 +76,6 @@ CURL_OPTIONS=${CURL_OPTIONS:-""}
GITHUB_API_TOKEN=${GITHUB_API_TOKEN:-""}
REDIRECTOR=${REDIRECTOR:-"https://builds.raspberrypi.com/github/linux"}

FW_REPO="${REPO_URI}.git"
FW_REPOLOCAL=${FW_REPOLOCAL:-"${WORK_PATH}/.rpi-firmware"}
FW_PATH="${BOOT_PATH}${FW_SUBDIR}"
FW_MODPATH="${ROOT_PATH}/lib/modules"
Expand All @@ -90,7 +89,7 @@ BOOTLOADER_REVFILE="${FW_PATH}/.bootloader_revision"

if [[ "$SKIP_KERNEL" == "" ]]; then
SKIP_KERNEL=0
if command -v vcgencmd > /dev/null; then
if command -v vcgencmd > /dev/null 2>&1; then
KERNEL=$(vcgencmd get_config str | grep -E "^kernel=" | cut -d= -f2)
case $KERNEL in
"" | kernel8.img | kernel_2712.img) ;;
Expand Down Expand Up @@ -407,7 +406,7 @@ function check_partition {

function check_initramfs {
local INITRAMFS=""
if command -v vcgencmd > /dev/null; then
if command -v vcgencmd > /dev/null 2>&1; then
INITRAMFS="$(echo =$(vcgencmd get_config ramfsfile) | cut -d'=' -f3)"
fi
if [ "$INITRAMFS" == "" ]; then
Expand Down Expand Up @@ -617,8 +616,8 @@ function download_rev {
}

function remove_rev {
echo " *** Deleting downloaded files"
if [[ ${SKIP_REPODELETE} -eq 0 ]]; then
echo " *** Deleting downloaded files"
rm -rf "${FW_REPOLOCAL}"
fi
}
Expand Down Expand Up @@ -728,12 +727,14 @@ if [[ ${NOOBS_CHECK} -eq 1 ]] && [[ -f "${BOOT_PATH}/recovery.elf" ]]; then
noobs_fix
fi

command -v readelf >/dev/null 2>&1 || {
echo " !!! This tool requires you have readelf installed, please install it first"
echo " In Debian, try: sudo apt-get install binutils"
echo " In Arch, try: pacman -S binutils"
exit 1
}
if [[ ${SKIP_VCLIBS} -ne 0 ]]; then
command -v readelf > /dev/null 2>&1 || {
echo " !!! This tool requires you have readelf installed, please install it first"
echo " In Debian, try: sudo apt-get install binutils"
echo " In Arch, try: pacman -S binutils"
exit 1
}
fi

FW_REV_IN=${FW_REV_IN:-master}
BOOTLOADER_REV_IN=${BOOTLOADER_REV_IN:-master}
Expand Down