Project

General

Profile

Feature #1832 ยป 6.0-llvmpipe.patch

Jeremy Rand, 09/10/2017 08:03 AM

View differences:

display/renderer/device-files/androidsw.sh
1
#!/system/bin/bash
2
#
3
# Copyright (C) 2017 Jeremy Rand <jeremy@veclabs.net>
4
# Partially based on code by Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> and Filippo Fil Bergamo
5
#
6
# This file is part of "Replicant Renderer Switcher", a set of shell scripts to switch between
7
# the Android Software Renderer and the llvmpipe renderer in Replicant.
8
#
9
# Replicant Renderer Switcher is free software: you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
11
# the Free Software Foundation, either version 3 of the License, or
12
# (at your option) any later version.
13
#
14
# Replicant Renderer Switcher is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
21

  
22
set -euf -o pipefail
23

  
24
grep -q "ro.libagl=0" /system/build.prop && renderer="llvmpipe" || renderer="android"
25

  
26
if [ "${renderer}" == "android" ]
27
then
28
    echo "Android software renderer is already enabled!"
29
    exit 1
30
fi
31

  
32
echo "Remounting system partition as writable..."
33
mount -o rw,remount /system
34

  
35
echo "Enabling Android software renderer..."
36
sed "s/ro.libagl=0/ro.libagl=1/" -i /system/build.prop
37

  
38
echo "Syncing filesystem..."
39
sync
40
sync
41

  
42
echo "Remounting system partition as read-only..."
43
mount -o ro,remount /system
44

  
45
echo "Syncing filesystem..."
46
sync
47
sync
48

  
49
# https://android.stackexchange.com/a/139139
50
echo "Android software renderer will be enabled after we reboot now..."
51
am start -a android.intent.action.REBOOT
display/renderer/device-files/llvmpipe.sh
1
#!/system/bin/bash
2
#
3
# Copyright (C) 2017 Jeremy Rand <jeremy@veclabs.net>
4
# Partially based on code by Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> and Filippo Fil Bergamo
5
#
6
# This file is part of "Replicant Renderer Switcher", a set of shell scripts to switch between
7
# the Android Software Renderer and the llvmpipe renderer in Replicant.
8
#
9
# Replicant Renderer Switcher is free software: you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
11
# the Free Software Foundation, either version 3 of the License, or
12
# (at your option) any later version.
13
#
14
# Replicant Renderer Switcher is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
21

  
22
set -euf -o pipefail
23

  
24
grep -q "ro.libagl=0" /system/build.prop && renderer="llvmpipe" || renderer="android"
25

  
26
if [ "${renderer}" == "llvmpipe" ]
27
then
28
    echo "llvmpipe is already enabled!"
29
    exit 1
30
fi
31

  
32
echo "Remounting system partition as writable..."
33
mount -o rw,remount /system
34

  
35
echo "Enabling llvmpipe..."
36
sed "s/ro.libagl=1/ro.libagl=0/" -i /system/build.prop
37

  
38
echo "Syncing filesystem..."
39
sync
40
sync
41

  
42
echo "Remounting system partition as read-only..."
43
mount -o ro,remount /system
44

  
45
echo "Syncing filesystem..."
46
sync
47
sync
48

  
49
# https://android.stackexchange.com/a/139139
50
echo "llvmpipe will be enabled after we reboot now..."
51
am start -a android.intent.action.REBOOT
display/renderer/setup.sh
1
root_dir="/data/misc/renderer"
2
adb root
3
sleep 3
4
adb shell mkdir -p "$root_dir"
5
adb push ./device-files/* "$root_dir/"
    (1-1/1)