Skip to content

Commit

Permalink
Merge branch future3/develop into future3/fix_disable_bookworm
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Nov 7, 2024
2 parents 22c1e02 + 32798da commit 30c81e2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 38 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile.jukebox
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM libzmq:local as libzmq
FROM libzmq:local AS libzmq
FROM debian:bullseye-slim

# These are only dependencies that are required to get as close to the
Expand Down
40 changes: 21 additions & 19 deletions installation/includes/02_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,44 +75,46 @@ get_architecture() {
echo $arch
}

is_raspbian() {
if [[ $( . /etc/os-release; printf '%s\n' "$ID"; ) == *"raspbian"* ]]; then
is_debian_based() {
local os_release_id=$( . /etc/os-release; printf '%s\n' "$ID"; )
if [[ "$os_release_id" == *"raspbian"* ]] || [[ "$os_release_id" == *"debian"* ]]; then
echo true
else
echo false
fi
}

get_debian_version_number() {
source /etc/os-release
echo "$VERSION_ID"
}

_get_boot_file_path() {
local filename="$1"
if [ "$(is_raspbian)" = true ]; then
if [ "$(is_bookworm_or_higher)" = true ]; then
echo "/boot/firmware/${filename}"
else
echo "/boot/${filename}"
fi
_get_debian_version_number() {
if [ "$(is_debian_based)" = true ]; then
local debian_version_number=$( . /etc/os-release; printf '%s\n' "$VERSION_ID"; )
echo "$debian_version_number"
else
echo "unknown"
echo "-1"
fi
}

is_bookworm_or_higher() {
is_debian_version_at_least() {
local expected_version=$1
if [ "$(is_raspbian)" = true ]; then
local debian_version_number=$(get_debian_version_number)

# Bookworm and higher
if [ "$debian_version_number" -ge 12 ]; then
if [ "$debian_version_number" -ge "$expected_version" ]; then
echo true
fi
fi
echo false
}

_get_boot_file_path() {
local filename="$1"
local is_debian_version_number_at_least_12=$(is_debian_version_at_least 12)
if [ "$(is_debian_version_number_at_least_12)" = true ]; then
echo "/boot/firmware/${filename}"
else
echo "/boot/${filename}"
fi
}

get_boot_config_path() {
echo $(_get_boot_file_path "config.txt")
}
Expand Down
18 changes: 0 additions & 18 deletions installation/install-jukebox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,6 @@ Check install log for details:"
exit 1
}

# Check if current distro is a 32-bit version
# Support for 64-bit Distros has not been checked (or precisely: is known not to work)
# All Raspberry Pi OS versions report as machine "armv6l" or "armv7l", if 32-bit (even the ARMv8 cores!)
_check_os_type() {
local os_type=$(uname -m)

print_lc "\nChecking OS type '$os_type'"

if [[ $os_type == "armv7l" || $os_type == "armv6l" ]]; then
print_lc " ... OK!\n"
else
print_lc "ERROR: Only 32-bit operating systems are supported. Please use a 32-bit version of Raspberry Pi OS!"
print_lc "For Pi 4 models or newer running a 64-bit kernels, also see this: https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/2041"
exit 1
fi
}

_check_existing_installation() {
if [[ -e "${INSTALLATION_PATH}" ]]; then
print_lc "
Expand Down Expand Up @@ -154,7 +137,6 @@ _load_sources() {
_setup_logging

### CHECK PREREQUISITE
_check_os_type
_check_existing_installation

### RUN INSTALLATION
Expand Down

0 comments on commit 30c81e2

Please sign in to comment.