From 0ed43e2c13db7bc24c153862cce9b97e27222b5c Mon Sep 17 00:00:00 2001 From: 2b-t <53856473+2b-t@users.noreply.github.com> Date: Sun, 29 Dec 2024 20:03:40 +0000 Subject: [PATCH] Closes #10; fix: Fix installation from Debian packages by installing package that the meta-package refers to instead of just the meta-package, document the changes in the manual installation guide and update unit tests accordingly --- doc/PreemptRt.md | 4 ++-- src/lib_install_debian.sh | 25 ++++++++++++++++--------- test/test_lib_install_debian.bats | 17 +++++++++-------- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/doc/PreemptRt.md b/doc/PreemptRt.md index ed3f058..adfed27 100644 --- a/doc/PreemptRt.md +++ b/doc/PreemptRt.md @@ -93,12 +93,12 @@ Afterwards you can reboot your system (be sure to select the correct kernel!) an ##### 1.2.2.2 Manual installation -Have a look at the search results resulting from [this query on package.debian.org](https://packages.debian.org/search?keywords=linux-image-rt-amd64) (potentially changing the architecture!) and see if you can find a kernel close to yours, e.g. [this one](https://packages.debian.org/bullseye/linux-image-rt-amd64). If you can find one click on the architecture `amd64` under `Download linux-image-rt-amd64` on the bottom and select a geographically suiting mirror and save the image in a location of your choice. +Have a look at the search results resulting from [this query on package.debian.org](https://packages.debian.org/search?keywords=linux-image-rt-amd64) and see if you can find a kernel close to yours, e.g. [this one](https://packages.debian.org/bullseye/linux-image-rt-amd64). If you can find one click on the dependency `dep` and then on the architecture `amd64` under `Download linux-image-*-rt-amd64` on the bottom and select a geographically suiting mirror and save the Debian package in a location of your choice. Finally install it by opening a terminal in this folder and typing ```shell -$ sudo dpkg -i linux-image-rt-amd64_5.10.106-1_amd64.deb +$ sudo dpkg -i linux-image-5.10.0-33-rt-amd64_5.10.226-1_amd64.deb $ sudo apt-get install -f ``` diff --git a/src/lib_install_debian.sh b/src/lib_install_debian.sh index 4c21611..42ffce3 100755 --- a/src/lib_install_debian.sh +++ b/src/lib_install_debian.sh @@ -14,21 +14,27 @@ function get_debian_versions() { echo $(cat /etc/debian_version | tr / " ") } -function get_preemptrt_file() { - declare desc="Get the PREEMPT_RT filename for the given Debian distribution by crawling the website" +function get_architecture() { + declare desc="Get the computer architecture" + echo $(dpkg --print-architecture) +} + +function get_preemptrt_debian_package() { + declare desc="Get the Debian package dependency referred to by the meta-package" local DEBIAN_VERSION=$1 - local ARCHITECTURE=$(dpkg --print-architecture) - echo $(curl -Ls https://packages.debian.org/${DEBIAN_VERSION}/${ARCHITECTURE}/linux-image-rt-${ARCHITECTURE}/download | grep -o -P '(?<=