Skip to content
Open
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
9 changes: 9 additions & 0 deletions linux/ubuntu/scripts/basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@
################################################################################
# source: https://github.com/actions/virtual-environments/blob/5ae2170ebe90a53e1cdc9c507ed3e0f1471d6b66/images/linux/scripts/helpers/install.sh

. /etc/os-release

apt-get update
# lib32z1 is not available for arm64 remove it via jq
case "$(uname -m)" in
'x86_64') common_packages_filter="" ;;
*) common_packages_filter="del(.apt.common_packages[] | select(. == \"lib32z1\"))" ;;
esac
case "${VERSION_ID}" in
'24.04')
jq '.apt.cmd_packages |= map(if . == "netcat" then "netcat-openbsd" else . end)' "/imagegeneration/toolset.json" > "/tmp/toolset.new.json" \
&& mv "/tmp/toolset.new.json" "/imagegeneration/toolset.json"
;;
*) ;;
esac
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all Ubuntu releases onward have this new package name:

Suggested change
esac
UBUNTU_MAJOR=${VERSION_ID%%.*}
if (( UBUNTU_MAJOR >= 24 )); then
jq '.apt.cmd_packages |= map(if . == "netcat" then "netcat-openbsd" else . end)' "/imagegeneration/toolset.json" > "/tmp/toolset.new.json" \
&& mv "/tmp/toolset.new.json" "/imagegeneration/toolset.json"
fi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately GitHub still has bugs, even when I select the correct lines 🤷

UBUNTU_MAJOR=${VERSION_ID%%.*}
if (( UBUNTU_MAJOR >= 24 )); then
  jq '.apt.cmd_packages |= map(if . == "netcat" then "netcat-openbsd" else . end)' "/imagegeneration/toolset.json" > "/tmp/toolset.new.json" \
    && mv "/tmp/toolset.new.json" "/imagegeneration/toolset.json"
fi

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is fine for me as well - do you want me to integrate this patch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to, yes, then Ubuntu 25+ would be working too 😄

common_packages=$(jq -r "$common_packages_filter .apt.common_packages[]" "/imagegeneration/toolset.json")
cmd_packages=$(jq -r ".apt.cmd_packages[]" "/imagegeneration/toolset.json")
# we depend on re-splitting behaviour here
Expand Down