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

[Desktop-lite]- libasound2 not installing in noble - issue #973

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
2 changes: 1 addition & 1 deletion src/desktop-lite/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "desktop-lite",
"version": "1.0.8",
"version": "1.1.0",
"name": "Light-weight Desktop",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/desktop-lite",
"description": "Adds a lightweight Fluxbox based desktop to the container that can be accessed using a VNC viewer or the web. GUI-based commands executed from the built-in VS code terminal will open on the desktop automatically.",
Expand Down
11 changes: 10 additions & 1 deletion src/desktop-lite/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ package_list="
libnotify4 \
libnss3 \
libxss1 \
libasound2 \
xfonts-base \
xfonts-terminus \
fonts-noto \
Expand Down Expand Up @@ -198,6 +197,16 @@ fi
# Install X11, fluxbox and VS Code dependencies
check_packages ${package_list}

# if Ubuntu-24.04, noble(numbat) found, then will install libasound2-dev instead of libasound2.
# this change is temporary, https://packages.ubuntu.com/noble/libasound2 will switch to libasound2 once it is available for Ubuntu-24.04, noble(numbat)
. /etc/os-release
if [ "${ID}" = "ubuntu" ] && [ "${VERSION_CODENAME}" = "noble" ]; then
echo "Ubuntu 24.04, Noble(Numbat) detected. Installing libasound2-dev package..."
check_packages "libasound2-dev"
else
check_packages "libasound2"
fi

# On newer versions of Ubuntu (22.04),
# we need an additional package that isn't provided in earlier versions
if ! type vncpasswd > /dev/null 2>&1; then
Expand Down
30 changes: 30 additions & 0 deletions test/desktop-lite/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,39 @@ set -e
# Optional: Import test library
source dev-container-features-test-lib

echoStderr()
{
echo "$@" 1>&2
}

checkOSPackage() {
LABEL=$1
PACKAGE_NAME=$2
echo -e "\n🧪 Testing $LABEL"
# Check if the package exists and retrieve its exact version
if [ "$(dpkg-query -W -f='${Status}' "$PACKAGE_NAME" 2>/dev/null | grep -c "ok installed")" -eq 1 ]; then
echo "✅ Package '$PACKAGE_NAME' is installed."
exit 0
else
echo "❌ Package '$PACKAGE_NAME' is not installed."
exit 1
fi
}

check "desktop-init-exists" bash -c "ls /usr/local/share/desktop-init.sh"
check "log-exists" bash -c "ls /tmp/container-init.log"
check "fluxbox-exists" bash -c "ls -la ~/.fluxbox"

. /etc/os-release
if [ "${ID}" = "ubuntu" ]; then
if [ "${VERSION_CODENAME}" = "noble" ]; then
checkOSPackage "if libasound2-dev exists !" "libasound2-dev"
else
checkOSPackage "if libasound2 exists !" "libasound2"
fi
else
checkOSPackage "if libasound2 exists !" "libasound2"
fi

# Report result
reportResults
Loading