From 0c1370b5f1b3e8abc934ea913a4377f05f32e4a9 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Mon, 7 Aug 2017 22:05:24 +0300 Subject: Initial static build --- docs/wiki/Tuning-sysfs/index.html | 99 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 docs/wiki/Tuning-sysfs/index.html (limited to 'docs/wiki/Tuning-sysfs/index.html') diff --git a/docs/wiki/Tuning-sysfs/index.html b/docs/wiki/Tuning-sysfs/index.html new file mode 100644 index 0000000..3b2115a --- /dev/null +++ b/docs/wiki/Tuning-sysfs/index.html @@ -0,0 +1,99 @@ + + + + + + postmarketOS + + + + + + + + + + + + + + + +
+
+ +

+ + postmarketOS +

+
+ + +

Tuning sysfs

+

After porting postmarketOS to your device, you might find that still some features don't work. You may need to adjust some values inside the /sys directory.

+

sysfs is a pseudo file system provided by the Linux kernel that exports information about various kernel subsystems, hardware devices, and associated device drivers from the kernel's device model to user space through virtual files. In addition to providing information about various devices and kernel subsystems, exported virtual files are also used for their configuring.

+

One approach is comparing the contents of these files when TWRP or LineageOS is running and the same for pmOS.

+

The following script dumps the content of /sys/devices. Copy it as dumpsys.sh

+
#!/bin/sh
+# dumpsys.sh
+DIR="/sys/devices"
+
+walk() {
+    for file in $(ls $1); do
+        path="$1/$file"
+        if test -L "$path"; then
+            continue
+        fi
+        if test -f "$path"; then
+            echo "$path"
+            cat "$path"
+        fi
+        if test -d "$path"; then
+            walk "$path"
+        fi
+    done
+}
+
+others() {
+    cat /proc/cpuinfo
+    cat /proc/cmdline
+}
+
+walk "$DIR"
+others
+ + +

Upload it to your device when running TWRP (use adb push) and when running postmarketOS (use scp). Run it and then compare the output.

+

For TWRP/LineageOS:

+
adb push dumpsys.sh /
+adb shell "sh /dumpsys.sh > /devices-twrp.dump"
+adb pull /devices-twrp.dump .
+ + +

For pmOS:

+
scp dumpsys.sh user@172.16.42.1:~
+# sh dumpsys.sh > devices-pmos.dump
+scp user@172.16.42.1:~/devices-pmos.dump .
+ + +

Then get the differences:

+
diff -u devices-pmos.dump devices-twrp.dump > devices.diff
+ + +

You could also run it in even in the stock ROM but it is important that you run the same kernel version in postmarketOS then.

+

Examples

+

i9070 port

+

This way, user drebrez figured out two values needed for the framebuffer configuration for the i9070 port.

+
echo 16 > /sys/devices/platform/mcde_fb/graphics/fb0/bits_per_pixel
+echo 960,1600 > /sys/devices/platform/mcde_fb/graphics/fb0/virtual_size
+ +
+
+ + \ No newline at end of file -- cgit v1.3.1