Skip to content

Commit 945cd6c

Browse files
committed
bash: squash some shellcheck warnings
- dead code for `kernel_id_to_use` (we're using USE_KERNEL_ID directly) - quoting for the `USE_LATEST_BUILT_KERNEL` case Signed-off-by: Ricardo Pardini <[email protected]>
1 parent 967cc2e commit 945cd6c

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

bash/kernel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ function resolve_latest_kernel_version_lts() { # Produces KERNEL_POINT_RELEASE
6060
# HookOS using an existing kernel container image from the registry. This only works with
6161
# unauthenticated registries.
6262
if [[ -n "${USE_LATEST_BUILT_KERNEL}" ]]; then
63-
reg="$(echo ${HOOK_KERNEL_OCI_BASE} | cut -d'/' -f1)"
64-
repo="$(echo ${HOOK_KERNEL_OCI_BASE} | cut -d'/' -f2-)"
63+
reg="$(echo "${HOOK_KERNEL_OCI_BASE}" | cut -d'/' -f1)"
64+
repo="$(echo "${HOOK_KERNEL_OCI_BASE}" | cut -d'/' -f2-)"
6565
# expected format is: 6.6.32-14b8be17 (major.minor.point-hash)
6666
latest_point_release="$(curl -sL "https://${reg}/v2/${repo}/tags/list" | jq -r ".tags[]" | grep -e "^${KERNEL_MAJOR}.${KERNEL_MINOR}" | sort -V | tail -n1 | cut -d"-" -f1 | cut -d"." -f3)"
6767
log info "Using latest point release from registry ${HOOK_KERNEL_OCI_BASE} for kernel ${KERNEL_MAJOR}.${KERNEL_MINOR}: ${latest_point_release}"

bash/kernel/kernel_default.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ function calculate_kernel_version_default() {
5555
input_hash="$(cat "kernel/configs/${INPUT_DEFCONFIG}" "kernel/Dockerfile" | sha256sum - | cut -d ' ' -f 1)"
5656
short_input_hash="${input_hash:0:8}"
5757
kernel_oci_version="${KERNEL_MAJOR}.${KERNEL_MINOR}.${KERNEL_POINT_RELEASE}-${short_input_hash}"
58-
59-
kernel_id_to_use="${inventory_id}"
60-
if [[ -n "${USE_KERNEL_ID}" ]]; then
61-
log warn "USE_KERNEL_ID is set to '${USE_KERNEL_ID}'; using it instead of the default inventory_id '${inventory_id}'."
62-
kernel_id_to_use="${USE_KERNEL_ID}"
63-
fi
64-
6558
kernel_oci_image="${HOOK_KERNEL_OCI_BASE}:${kernel_oci_version}"
6659

6760
# Log the obtained version & images to stderr

0 commit comments

Comments
 (0)