Unverified Commit 4d2dabec authored by Gaurav Saini's avatar Gaurav Saini Committed by GitHub

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

* [Desktop-lite]- libasound2 not installing in noble - issue

* bump to patch version in Desktop-lite feature

* misc change

* Changes for comments ( review comments )

* changes based on review comments..
parent 67c10a66
{
"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.",
......
......@@ -41,7 +41,6 @@ package_list="
libnotify4 \
libnss3 \
libxss1 \
libasound2 \
xfonts-base \
xfonts-terminus \
fonts-noto \
......@@ -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
......
......@@ -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
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment