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

fix: Use correct raspi-config command for bookworm #2450

Merged
merged 7 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
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
43 changes: 31 additions & 12 deletions installation/includes/02_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,42 @@ get_architecture() {
echo $arch
}

_get_boot_file_path() {
local filename="$1"
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() {
if [ "$(is_debian_based)" = true ]; then
local debian_version_number=$( . /etc/os-release; printf '%s\n' "$VERSION_ID"; )
echo "$debian_version_number"
else
echo "-1"
fi
}

# Bullseye and lower
if [ "$debian_version_number" -le 11 ]; then
echo "/boot/${filename}"
# Bookworm and higher
elif [ "$debian_version_number" -ge 12 ]; then
echo "/boot/firmware/${filename}"
else
echo "unknown"
fi
is_debian_version_at_least() {
local expected_version=$1
local debian_version_number=$(get_debian_version_number)

if [ "$debian_version_number" -ge "$expected_version" ]; then
echo true
else
echo false
fi
}

_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 "unknown"
echo "/boot/${filename}"
fi
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/usr/bin/env bash

source ../../../../../../installation/includes/02_helpers.sh

echo "Entering setup.inc.sh"

echo "Disabling login shell to be accessible over serial"
sudo raspi-config nonint do_serial 1

if [ "$(is_debian_version_at_least 12)" = true ]; then
sudo raspi-config nonint do_serial_hw 1
sudo raspi-config nonint do_serial_cons 1
else
sudo raspi-config nonint do_serial 1
end

echo "Enabling serial port hardware"
sudo raspi-config nonint set_config_var enable_uart 1 /boot/config.txt
Expand Down