From 5e4c167b20f78de9b8bd7bb4bafe98ce0decf4c1 Mon Sep 17 00:00:00 2001 From: s-martin Date: Sun, 3 Nov 2024 15:00:05 +0000 Subject: [PATCH 1/6] use correct raspi-config command for bookworm --- installation/includes/02_helpers.sh | 12 ++++++++++++ .../rfid/hardware/rdm6300_serial/setup.inc.sh | 10 +++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/installation/includes/02_helpers.sh b/installation/includes/02_helpers.sh index dfad65187..33028cef2 100644 --- a/installation/includes/02_helpers.sh +++ b/installation/includes/02_helpers.sh @@ -107,6 +107,18 @@ _get_boot_file_path() { fi } +is_bookworm_or_higher() { + if [ "$(is_raspbian)" = true ]; then + local debian_version_number=$(get_debian_version_number) + + # Bookworm and higher + if [ "$debian_version_number" -ge 12 ]; then + echo true + fi + fi + echo false +} + get_boot_config_path() { echo $(_get_boot_file_path "config.txt") } diff --git a/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh b/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh index 364f07cd9..0f308669d 100755 --- a/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh +++ b/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh @@ -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_bookworm_or_higher)" = 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 From 0febf679de32a2502f9827a1159d1ab81cc9c241 Mon Sep 17 00:00:00 2001 From: s-martin Date: Sun, 3 Nov 2024 20:36:16 +0000 Subject: [PATCH 2/6] simplify _get_boot_file_path --- installation/includes/02_helpers.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/installation/includes/02_helpers.sh b/installation/includes/02_helpers.sh index 33028cef2..92e47566d 100644 --- a/installation/includes/02_helpers.sh +++ b/installation/includes/02_helpers.sh @@ -91,16 +91,10 @@ get_debian_version_number() { _get_boot_file_path() { local filename="$1" if [ "$(is_raspbian)" = true ]; then - local debian_version_number=$(get_debian_version_number) - - # Bullseye and lower - if [ "$debian_version_number" -le 11 ]; then - echo "/boot/${filename}" - # Bookworm and higher - elif [ "$debian_version_number" -ge 12 ]; then + if [ "$(is_bookworm_or_higher)" = true ]; then echo "/boot/firmware/${filename}" else - echo "unknown" + echo "/boot/${filename}" fi else echo "unknown" From 9fed28b7b0addafa00e55b986b9020e6df2929c9 Mon Sep 17 00:00:00 2001 From: s-martin Date: Sun, 3 Nov 2024 20:45:43 +0000 Subject: [PATCH 3/6] fix path --- .../components/rfid/hardware/rdm6300_serial/setup.inc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh b/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh index 0f308669d..f8e60e4b4 100755 --- a/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh +++ b/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source ../../../../../../installation/includes/02_helpers.sh +source ../../../../../installation/includes/02_helpers.sh echo "Entering setup.inc.sh" From 22c1e0289fcf9450e5b6155daa02f284ac540557 Mon Sep 17 00:00:00 2001 From: s-martin Date: Sun, 3 Nov 2024 21:08:14 +0000 Subject: [PATCH 4/6] revert last commit --- .../components/rfid/hardware/rdm6300_serial/setup.inc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh b/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh index f8e60e4b4..0f308669d 100755 --- a/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh +++ b/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source ../../../../../installation/includes/02_helpers.sh +source ../../../../../../installation/includes/02_helpers.sh echo "Entering setup.inc.sh" From 77afd87bc8cbf06a91554cb5fe598573ef777dba Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Thu, 7 Nov 2024 12:15:10 +0100 Subject: [PATCH 5/6] merge fixes --- .../components/rfid/hardware/rdm6300_serial/setup.inc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh b/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh index 0f308669d..c9935c739 100755 --- a/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh +++ b/src/jukebox/components/rfid/hardware/rdm6300_serial/setup.inc.sh @@ -6,7 +6,7 @@ echo "Entering setup.inc.sh" echo "Disabling login shell to be accessible over serial" -if [ "$(is_bookworm_or_higher)" = true ]; then +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 From 25350020b2a8400acc66af085a7185aa572fa75f Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Thu, 7 Nov 2024 12:16:49 +0100 Subject: [PATCH 6/6] merge fixes --- installation/includes/02_helpers.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/installation/includes/02_helpers.sh b/installation/includes/02_helpers.sh index c0d343d04..440e10b08 100644 --- a/installation/includes/02_helpers.sh +++ b/installation/includes/02_helpers.sh @@ -95,14 +95,13 @@ _get_debian_version_number() { is_debian_version_at_least() { local expected_version=$1 - if [ "$(is_raspbian)" = true ]; then - local debian_version_number=$(get_debian_version_number) + local debian_version_number=$(get_debian_version_number) - if [ "$debian_version_number" -ge "$expected_version" ]; then - echo true - fi + if [ "$debian_version_number" -ge "$expected_version" ]; then + echo true + else + echo false fi - echo false } _get_boot_file_path() {