-
Notifications
You must be signed in to change notification settings - Fork 4
/
start-chromium.sh
executable file
·73 lines (61 loc) · 2.17 KB
/
start-chromium.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
# default URL
URL="www.toradex.com"
# Enable GPU support by default
ENABLE_GPU=1
# default parms for kiosk mode
chromium_parms_base="--test-type --allow-insecure-localhost --disable-notifications --check-for-update-interval=315360000 "
chromium_parms="--kiosk "
# Additional params should be stacked chromium_parms_extended="$chromium_parms_extended ..."
chromium_parms_extended=""
# FIXME: TOR-1426: work around seccomp-bpf failures in chromium.
chromium_parms_extended="$chromium_parms_extended --disable-seccomp-filter-sandbox"
for arg in "$@"
do
case $arg in
--window-mode)
chromium_parms="--start-maximized --app="
shift
;;
--browser-mode)
chromium_parms="--start-maximized "
shift
;;
--virtual-keyboard)
# Load the virtual keyboard
chromium_parms_extended="$chromium_parms_extended --load-extension=/chrome-extensions/chrome-virtual-keyboard-master"
shift
;;
--disable-gpu)
# Disable GPU support completely
ENABLE_GPU=0
shift
;;
--disable-gpu-compositing)
# Disable GPU Compositing only
chromium_parms_extended="$chromium_parms_extended --disable-gpu-compositing"
shift
;;
esac
done
# Disable GPU support for GPU-less devices
if [ "$MACHINE" = "colibri-imx7-emmc" ] || [ "$MACHINE" = "colibri-imx6ull-emmc" ]; then
ENABLE_GPU=0
fi
# Setup GPU flags
if [ "$ENABLE_GPU" -eq "1" ]; then
# Use EGL and OpenGL ES instead of GLX and regular OpenGL
chromium_parms_extended="$chromium_parms_extended --use-gl=egl"
# Ozone parameters
chromium_parms_extended="$chromium_parms_extended --enable-features=UseOzonePlatform --ozone-platform=wayland"
# Run the GPU process as a thread in the browser process.
# This is required to use Wayland EGL path
# See: https://github.com/OSSystems/meta-browser/issues/510#issuecomment-854653930
chromium_parms_extended="$chromium_parms_extended --in-process-gpu"
else
chromium_parms_extended="$chromium_parms_extended --disable-gpu"
fi
if [ ! -z "$1" ]; then
URL=$1
fi
exec chromium $chromium_parms_base $chromium_parms_extended $chromium_parms$URL