KASM-1209 Add ability to disable autostart and host checks

This commit is contained in:
Justin Travis 2023-12-29 09:15:27 -05:00
parent 3cd02e4952
commit 92fecee172
No known key found for this signature in database
2 changed files with 18 additions and 6 deletions

View File

@ -19,3 +19,5 @@ See [Redroid Docs](https://github.com/remote-android/redroid-doc?tab=readme-ov-f
* `REDROID_HEIGHT` - Set the desired height of the redroid device
* `REDROID_DPI` - Set the desired DPI of the redroid device
* `REDROID_SHOW_CONSOLE` - Display the scrcpy console after launching the redroid device.
* `REDROID_DISABLE_AUTOSTART` - If set to "1", the container will not automatically pull and start the redroid container and scrcpy.
* `REDROID_DISABLE_HOST_CHECKS` - If set to "1", the container will not check for the presence of required host level kernel modules.

View File

@ -12,6 +12,8 @@ REDROID_WIDTH=${REDROID_WIDTH:-"720"}
REDROID_HEIGHT=${REDROID_HEIGHT:-"1280"}
REDROID_DPI=${REDROID_DPI:-"320"}
REDROID_SHOW_CONSOLE=${REDROID_SHOW_CONSOLE:-"1"}
REDROID_DISABLE_AUTOSTART=${REDROID_DISABLE_AUTOSTART:-"0"}
REDROID_DISABLE_HOST_CHECKS=${REDROID_DISABLE_HOST_CHECKS:-"0"}
ICON_ERROR="/usr/share/icons/ubuntu-mono-dark/status/22/system-devices-panel-alert.svg"
@ -88,12 +90,16 @@ kasm_startup() {
set +e
sudo /usr/bin/supervisord -n &
set -e
if [ "$REDROID_DISABLE_AUTOSTART" == "0" ]; then
start_android
fi
fi
if [ "$REDROID_DISABLE_AUTOSTART" == "0" ]; then
if ! pgrep -x $SCRCPY_PGREP > /dev/null
then
start_scrcpy
fi
fi
sleep 1
done
set -x
@ -104,5 +110,9 @@ kasm_startup() {
/usr/bin/filter_ready
/usr/bin/desktop_ready
check_modules
if [ "$REDROID_DISABLE_HOST_CHECKS" == "0" ]; then
check_modules
fi
kasm_startup