diff options
| author | Jibon Costa <jiboncosta57@gmail.com> | 2020-03-26 18:07:12 +0600 |
|---|---|---|
| committer | Jibon Costa <jiboncosta57@gmail.com> | 2020-03-26 18:07:12 +0600 |
| commit | 7a30b088be795c9c033d78b07b9744917bfa22ab (patch) | |
| tree | 1d1fd6089c8385ce162ccf6510869dea07cf6e6f | |
| parent | 9ee746c9484d9afc7168d3d4398e0e2df1d4b78d (diff) | |
| download | bbb-recorder-7a30b088be795c9c033d78b07b9744917bfa22ab.tar.gz bbb-recorder-7a30b088be795c9c033d78b07b9744917bfa22ab.zip | |
checker
| -rwxr-xr-x | dependencies_check.sh | 70 | ||||
| -rwxr-xr-x | namespace_checker.sh | 21 |
2 files changed, 91 insertions, 0 deletions
diff --git a/dependencies_check.sh b/dependencies_check.sh new file mode 100755 index 0000000..5f60992 --- /dev/null +++ b/dependencies_check.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +packages="gconf-service +libasound2 +libatk1.0-0 +libc6 +libcairo2 +libcups2 +libdbus-1-3 +libexpat1 +libfontconfig1 +libgcc1 +libgconf-2-4 +libgdk-pixbuf2.0-0 +libglib2.0-0 +libgtk-3-0 +libnspr4 +libpango-1.0-0 +libpangocairo-1.0-0 +libstdc++6 +libx11-6 +libx11-xcb1 +libxcb1 +libxcomposite1 +libxcursor1 +libxdamage1 +libxext6 +libxfixes3 +libxi6 +libxrandr2 +libxrender1 +libxss1 +libxtst6 +ca-certificates +fonts-liberation +libappindicator1 +libnss3 +lsb-release +xdg-utils +wget" + +declare -a neededPackages + +for packageName in $packages; do + if ! dpkg-query -l "$packageName" > /dev/null 2>&1; then + neededPackages[${#neededPackages[@]}]="$packageName" + fi +done + + +neededCount=${#neededPackages[@]} + +if [[ $neededCount -gt 0 ]]; then + echo "-----------------------------------------------------" + echo "Run the following to get all of the required packages" + echo "-----------------------------------------------------" + echo "sudo apt install \\" + for i in "${neededPackages[@]}"; do + output="$i" + + if [[ ${neededPackages[@]: -1 } != "$i" ]]; then + output+=" \\" + fi + + echo "$output" + done + echo "-----------------------------------------------------" +fi + +exit 0
\ No newline at end of file diff --git a/namespace_checker.sh b/namespace_checker.sh new file mode 100755 index 0000000..801ab81 --- /dev/null +++ b/namespace_checker.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +VALUE=$(cat /boot/config-$(uname -r) | grep CONFIG_USER_NS) + +if [[ -z "$VALUE" ]] +then + echo 'You do not have namespacing in the kernel. You will need to enable the SUID sandbox or upgrade your kernel.' + echo 'See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md' + exit 1 +fi + +USER_NS_AVAILABLE="${VALUE: -1}" + +if [[ "$USER_NS_AVAILABLE" == "y" ]] +then + exit 0 +else + echo 'You do not have namespacing in the kernel. You will need to enable the SUID sandbox or upgrade your kernel.' + echo 'See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md' + exit 1 +fi
\ No newline at end of file |
