nyuuzyou/wikis huggingface dataset:
USB Tethering

This is a guide for using the mobile data or wifi of a postmarketOS device through USB on your host device. For the inverse see the USB Internet page if you need to use the USB connection to get internet from your host into the postmarketOS device.
== Automatically (SXMO) ==
Open menu "Networks", select menu "Add a USB Hotspot", you'll be prompt to set a profile name (e.g. USB Tethering).
Activate the newly created interface (i.e. USB Tethering) by selecting it.
Your computer should receive internet traffic from your postmarketOS device automatically.
== Manually ==
If you don't use SXMO, you should follow the following instructions.
To make USB Tethering to work, you'll have to repeat these instructions every time your system reboots.
=== Recommended ===
Since version 23.06, a network profile "USB Networking" has been added in order to facilitate tethering on all variants of postmarketOS.
This is the simple and non-intrusive manner to enable USB Tethering.
Once USB cable is connected, execute the following commands.
$ nmcli c modify '83bd1823-feca-4c2b-9205-4b83dc792e1f' ipv4.method shared
$ nmcli d reapply usb0
If you want to restore the original behavior, use the manual method:
$ nmcli c modify '83bd1823-feca-4c2b-9205-4b83dc792e1f' ipv4.method manual
$ nmcli d reapply usb0
In case the above solution doesn't work, please send us a report on the issue tracker.
=== Using Root ===
==== On the postmarketOS device ====
On the postmarketOS device side, the firewall needs to be configured to perform NAT between the USB interface and its default gateway. The default gateway can be either the WiFi or the modem in the device.
First enable ip forwarding between the interfaces:
# sysctl net.ipv4.ip_forward=1
Then adjust the firewall configuration to NAT between the USB interface and the other interfaces
# nft add table inet nat
# nft 'add chain inet nat postrouting { type nat hook postrouting priority 100 ; }'
# nft add rule inet nat postrouting iifname "usb*" masquerade
The default nftables configuration in postmarketOS already has the other rules setup to make USB tethering work.
==== On the host side ====
Plug the postmarketOS device into your PC or laptop and run a DHCP client against the USB interface that shows up. It's also possible to use a static IP configuration.
address 172.16.42.2
netmask 255.255.255.0
gateway 172.16.42.1
If your host has automatically done DHCP on the USB interfaces, as is common on most Linux distributions. The only thing required is setting the default gateway to the USB interface since the
DHCP server on the postmarketOS device does not set the default gateway.
remove the existing default route if you have one
# ip route del default
Add a default route through the postmarketOS device
# ip route add default via 172.16.42.1
== Troubleshoot ==
To restore the default USB Networking interface, execute the following command.
# rm /etc/NetworkManager/system-connections/83bd1823-feca-4c2b-9205-4b83dc792e1f.nmmeta
$ nmcli connection reload
== See also ==
* USB Internet
* USB tethering support
* Second USB tethering connection
USB booting

Similar to SD card installation, pmOS can be also installed on USB drives.
== Prerequisites ==
* Device with OTG support, and extcon is included in initramfs.
* the PMIC supports the power to OTG devices, and included in initramfs.
** Otherwise, a hub with external power supply is required.
** USB HDD also requires external power supply.
* module usb-storage is enabled in initramfs.
** It has been added in 
* Rootfs image, created by either:
** Using pre-built images
** Using pmbootstrap running on Linux
* USB flash drive or HDD
== Pre-built images ==
# 
dd if=/path/to/<vendor>-<codename>.img \
 of=/dev/<usb_drive> \
 bs=4M status=progress
# Use fastboot or heimdall
#* fastboot: 
fastboot flash boot /path/to/<vendor>-<codename>-boot.img
#* heimdall: 
heimdall flash --BOOT /path/to/<vendor>-<codename>-boot.img
== pmbootstrap ==
# pmbootstrap install --disk=/dev/<usb_drive>
#* When using legacy option --sdcard, postmarketOS/pmbootstrap@942ee207 is required to ignore sdcard check.
#* Alternatively you can also run pmbootstrap install and use dd: 
pmbootstrap install
dd if=~/.local/var/pmbootstrap/chroot_native/home/pmos/rootfs/<vendor>-<codename>.img \
 of=/dev/<usb_drive> \
 bs=4M status=progress
# pmbootstrap flasher flash_kernel
# Insert the USB drive to OTG and boot
Umidigi F2 (umidigi-f2)

== Contributors ==
* ptrcnull
== Users owning this device ==
== How to enter flash mode ==
Fastboot: Hold down POWER and VOL DOWN. Use volume buttons to navigate to Fastboot and press power.
== Installation ==
== What doesn't work ==
=== WiFi ===
Kernel driver compiles, but returns I/O error when trying to enable it via /dev/wmtWifi (as explained here).
 [ 135.913610] (4)[6862:modprobe][WMT-DETECT][I]wmt_detect_driver_init:driver(major 154) installed success
 [ 135.915255] (4)[6862:modprobe][MTK-WIFI] WIFI_init[I]: mtk_wmt_wifi_chrdev driver(major 153) installed
 [ 135.977070] (4)[6862:modprobe][HIF-SDIO][I]mtk_wcn_wmt_wlan_reg:wmt wlan cb register
 [ 169.338409] (2)[6913:ash][MTK-WIFI] WIFI_open[I]: major 153 minor 0 (pid 6913)
 [ 169.338438] (2)[6913:ash][MTK-WIFI] WIFI_write[I]: WIFI_write 1
 [ 169.338446] (2)[6913:ash]../drivers/misc/mediatek/connectivity/common/common_main/core/wmt_lib.c, 1519, (!RB_EMPTY(pOpQ))
 [ 169.338452] (2)[6913:ash][HIF-SDIO][W]wmt_lib_get_op:RB_GET(00000000ff019d6f) return NULL
 [ 169.338454] (2)[6913:ash]Queue is NULL, name: wmtd_thread
 [ 169.338457] (2)[6913:ash]Queue is NULL, name: wmtd_worker_thread
 [ 169.338467] (2)[6913:ash]../drivers/misc/mediatek/connectivity/common/common_main/core/wmt_lib.c, 1533, (pOp)
 [ 169.338470] (2)[6913:ash]../drivers/misc/mediatek/connectivity/common/common_main/core/wmt_lib.c, 1519, (!RB_EMPTY(pOpQ))
 [ 169.338473] (2)[6913:ash][HIF-SDIO][W]wmt_lib_get_op:RB_GET(00000000ff019d6f) return NULL
 [ 169.338475] (2)[6913:ash]Queue is NULL, name: wmtd_thread
 [ 169.338477] (2)[6913:ash]Queue is NULL, name: wmtd_worker_thread
 [ 169.338486] (2)[6913:ash]../drivers/misc/mediatek/connectivity/common/common_main/core/wmt_lib.c, 1533, (pOp)
 [ 169.338489] (2)[6913:ash][MTK-WIFI] WIFI_write[E]: WMT turn on WIFI fail!
 [ 169.338513] (2)[6913:ash][MTK-WIFI] WIFI_close[I]: major 153 minor 0 (pid 6913)
=== Bluetooth ===
Same as above:
 [MTK-BT] BT_open: major 192 minor 0 (pid 8406)
 ../drivers/misc/mediatek/connectivity/common/common_main/core/wmt_lib.c, 1519, (!RB_EMPTY(pOpQ))
 [HIF-SDIO][W]wmt_lib_get_op:RB_GET(00000000ff019d6f) return NULL
 Queue is NULL, name: wmtd_thread
 Queue is NULL, name: wmtd_worker_thread
 FreeOpQ(00000000ff019d6f), sz:0/0, rd:0, wt:0
 ActiveOpQ(00000000ed1c1d3b), sz:0/0, rd:0, wt:0
 ../drivers/misc/mediatek/connectivity/common/common_main/core/wmt_lib.c, 1533, (pOp)
 [MTK-BT] BT_open: WMT turn on BT fail!
=== Battery capacity ===
/sys/class/power_supply/battery/ returns static data, capacity is always at the level it was during boot.
== See also ==
* Kernel sources (incomplete)
* Teracube One (teracube-one) with the same chipset
* Kernel sources for Nokia 5.1 Plus (also the same chipset)
UnifiedPush

UnifiedPush is an open standard and protocol for push notifications. It standardize communication between application service -> push service and push service -> application.
== KUnifiedPush ==
KUnifiedPush is KDE's library for UnifiedPush.
https://github.com/KDE/kunifiedpush
== GNOME ==
Purism's developer Guido Günther: 
https://social.librem.one/@agx/106674637106532626
== Supported apps ==
WIP
* NeoChat
== See also ==
* Push notifications
== Links ==
* Website of UnifiedPush
Unihertz Titan Pocket (unihertz-titan-pocket)

== Contributors ==
* aa13q
== Users owning this device ==
== How to enter flash mode ==
== Installation ==
Use pmbootstrap to build your own installation image.
$ pmbootstrap init
== See also ==
* Ubuntu Touch device tree for Unihertz Titan Pocket and Titan Slim
* gargoyle GSI: LineageOS 20 for Unihertz Titan, Pocket and Slim
* A collection of tools and guides to help make the Titan Pocket more usable (and to get it rooted)
Unixbench

== Introduction ==
UnixBench is a benchmarking tool that measures the performance of Unix-like operating systems. It provides a set of tests that evaluate various aspects of system performance, including CPU, memory, file I/O, and other system operations.
The generated results can be used to compare the performance of different hardware configurations, as well as to track changes in system performance over time. It is often used by system administrators, hardware, and software developers to evaluate the impact of system changes, optimizations, and upgrades.
=== The meaning of result level ===
A high score typically indicates better performance, while a low score indicates poorer performance. When running UnixBench tests on a system, the tool generates a composite score based on the results of individual tests across various system components.
A high score can suggest that the system performs well across different aspects tested by the benchmark, such as CPU performance, memory access speed, disk I/O performance, and other system operations. This can be an indication of good overall system performance and responsiveness.
A low score may indicate that the system is underperforming in one or more areas tested by the benchmark. This could be due to factors such as outdated hardware, inefficient system configurations, resource limitations, or bottlenecks that are impacting overall system performance.
== Instructions ==
Running a benchmark:
Install the package.
$ sudo ubench whets dhry
make all
make[1]: Entering directory '/usr/share/unixbench'
Checking distribution of files
./pgms exists
./src exists
./testdir exists
make[1]: Leaving directory '/usr/share/unixbench'
Checking distribution of files
./pgms exists
./src exists
./testdir exists
...snip...
========================================================================
 BYTE UNIX Benchmarks (Version 5.1.3)
 System: motorola-cedric: Linux
 OS: Linux -- 3.18.113-lineage -- #1-postmarketOS SMP PREEMPT Sun Jan 20 14:20:57 UTC 2019
 Machine: aarch64 (unknown)
 Language: en_US.utf8 (charmap=, collate=)
 18:41:30 up 18 min, load average: 4.60, 4.53, 3.30; runlevel 
------------------------------------------------------------------------
Benchmark Run: Sun Jan 20 2019 18:41:30 - 18:46:19
...results here...
If unixbench mentions 0 CPUs in system; running 1 parallel copy of tests then it couldn't correctly find the number of cpu's in /proc/cpuinfo.
In that case you can override the number of cores with an environment variable:
$ sudo NUMBER_OF_PROCESSORS=4 ubench whets dhry
... benchmark runs ...
If unixbench still uses only 1 CPU, bringing all CPUs on-line before might help.
# echo 4 > /sys/devices/system/cpu/cpunum_qos/min_core_num
Category:Guide
== Benchmark results ==
Unlocking Bootloaders/HMD Global

Most HMD (Nokia) devices sadly can't be unlocked with any official methods anymore. This page lists unofficial methods for some devices.
Model 	Unlock method
Nokia 1 (nokia-frt) / 1 Plus 	MD5 Method
Nokia 1.3 	Just fastboot oem unlock without any key
Nokia 2 / 2 V 	Hikari Calyx UU4
Nokia 2.2 	mtkclient
Nokia 2.3 	mtkclient
Nokia 3 (nokia-ne1) 	MD5 Method
HMD Global Nokia 3.1 (nokia-ES2) / 3.1 Plus	Hikari Calyx UU4
Nokia 3.2 	Just fastboot oem unlock without any key
Nokia 4.2 (nokia-panther) 	Just fastboot oem unlock without any key
Nokia 5 (nokia-nd1) 	Hikari Calyx UU4
Nokia 5.1 / 5.1 Plus 	Hikari Calyx UU4
Nokia 5.3 	See this XDA thread
HMD Global Nokia 6 (nokia-ple) 	Hikari Calyx UU4
HMD Global Nokia 6.1 (nokia-PL2) 	Hikari Calyx UU4
HMD Global Nokia 6.1 Plus (nokia-DRG) 	Hikari Calyx UU4
Nokia 7 / 7 Plus 	Hikari Calyx UU4
Nokia 7.1 	Hikari Calyx UU4
Nokia 7.2 (nokia-daredevil) 	See here
Nokia 8 / 8 Sirocco 	Hikari Calyx UU4
Nokia 8.1 	Hikari Calyx UU4
Nokia 8.3 5G / 8V 5G UW 	See this XDA thread
Nokia 9 PureView 	Hikari Calyx UU4
Nokia C2 Tava 	mtkclient
Nokia X71 	Hikari Calyx UU4
== Hikari Calyx UU4 Method ==
First request your bootloader unlock here and then follow this guide if you're on Linux.
== MD5 Method ==
Get your device's serial number (e.g. adb get-serialno), get the md5 checksum of it and run fastboot oem key YOUR_MD5_SUM in fastboot mode. Then unlock with fastboot flashing unlock.
Category:Bootloaders
Unlocking Bootloaders/Lenovo ZUI

Most Lenovo devices running Android ZUI require a signed file to unlock the bootloader.
== Before unlocking ==
* Backup your data, because your device will reset to factory settings, there's no way around this.
* Update your system to the latest version, this can be done using the system updates or via the RSA tool linked bellow.
* Go to "Settings → General settings → Developer options" and enable "OEM Unlocking".
* Go to "Settings → About tablet → Status" and write down your "Serial number", it's needed later.
== Request signed sn.img ==
* Create a Lenovo account. The same account will be used for the Lenovo forums, support pages, RSA and ZUI.com. NOTE: One account can unlock only 3 devices per year.
* Register the product "Serial number" in your Lenovo account.
* Go to https://www.zui.com/iunlock - it's a website in Chinese, you can use an online translator to translate text, but use copy/paste, don't use the full-page translator.
* Read all the text from that page, there are many notes on what to expect and how to actually perform the unlock.
* Follow the instructions on the page. There are 4 main categories on the side. The first one is for Lenovo Mobile the last for Lenovo (WiFi-only) Tablets, there's also one section for Lenovo ZUK devices. Select one.
* There's a Log in now link in the first line of each category, it will redirect you to a page where you need to login with a Chinese phone number, but there's also a link to Sign In with Email.
* Fill in the form details, IMEI, SN, email, solve the captcha and accept terms and conditions.
* Wait for your request to be processed and make sure to also check your Spam directory, not just your Inbox. You'll have to wait up to one day for your request to be processed.
== Unlocking ==
* Open the received email and download the sn.img file received. It's a link to http://cdn.zui.lenovomm.com/developer/tabletboot/ABCDEFGH/sn.img, where ABCDEFGH is the serial number of your device.
* Reboot into fastboot mode.
* Flash the image using fastboot flash unlock sn.img
* Unlock using fastboot oem unlock-go. You need to quickly confirm using the volume buttons. If you get the error "Prohibit unlock operation", it's because you forgot to enable "OEM unlocking" in "Developer options".
* Check if bootloader is now unlocked fastboot getvar unlocked
== See also ==
* Lenovo Rescue and Smart Assistant (RSA), known as "Software Fix" on the product support pages.
Category:Bootloaders
Upstream compatibility with Alpine

This article explains how to do maintenance in pmaports.git, to make sure it stays compatible with Alpine edge. Upstream compatibility checks are running hourly in the monitoring repository, and the badge of upstream compatibility is visible in the pmaports gitlab project. Information might be incomplete (as of writing, this was just started to document how to fix python breakage), please extend what is missing for future reference.
To simply bump the pkgrel of a package, use pmbootstrap pkgrel_bump name-of-pkg.
If there is noticeable fallout for users, make a post for the edge blog.
=== cross / aportgen ===
Most of the packages in the cross dir of pmaports are automatically generated from Alpine. If Alpine has a new version, and the upstream compat check complains about it, do this (example with binutils-* packages):
$ cd cross
$ pmbootstrap aportgen binutils-*
$ git diff # look through it, make sure everything looks good!
$ git commit -m "cross/binutils-*: upgrade to 1337"
If you are confident that this will work, then push it directly to pmaports.git. This makes sense for gcc especially, because it needs to be updated right after gcc is updated in Alpine - or else cross compilation is broken. Other packages are usually not as urgent. If you are unsure, better make a merge request and wait until CI confirms that this builds.
=== Python upgrade ===
If python was upgraded in Alpine to a new version (e.g. 3.8 to 3.9), all packages need to be rebuilt, which:
* Depend on libpython (e.g. so:libpython3.8.so.1.0).
** Monitoring will warn about these.
* Install files to /usr/lib/python3.8/ (or other version).
** Monitoring does not warn about these (would be possible with abuild#10029).
** Use pkgs.postmarketos.org to find these.
Bump relevant pkgrels and make a MR. This should be trivial, so you can merge it once everything builds.
Category:Technical_Reference
Upstreaming

It is important for us to contribute the patches and improvements we made to various software back to the original project. So everyone can benefit from the improvements and we don't need to maintain and carry around patches. Not every patch is listed here, but it might be a good idea to keep track of them anyway.
=== Successful ===
* 2019-xx-xx Alpine: PureTryOut upstreamed the whole KDE desktop, with all its dependencies, into Alpine and maintains it there
* 2019-08-05 abuild: rename makedepends_host virtual package
* 2019-03-06 abuild: abuild-tar.static: fix undefined reference errors
* 2019-02-06 Alpine: qt5-qtvirtualkeyboard, qt5-qtwayland, qt5-qtspeech
* 2018-12-20 Weston: compositor-fbdev: add support for ABGR
* 2018-12-31 Alpine: enable virglrenderer in QEMU aport (-> now we were able to remove our temp/qemu fork!)
* 2018-09-20 Alpine: Add armv7 next to armhf in the arch line
* 2018-07-04 QEMU: module: Use QEMU_MODULE_DIR as a search path
* 2018-03-31 abuild: properly check arguments and improve usage()
* 2018-01-06 Alpine: split linux-firmware into subpackages
* 2017-09-22 Alpine: clutter: add libxi-dev makedepend
* 2017-09-22 SDL2: Fix directfb compile error relating to C90
* 2017-09-21 Alpine: add directfb
* 2017-09-21 Alpine: add tslib
* 2017-09-11 ofono: Fix initialization of isimodem driver
* 2017-08-28 SDL2: Default libGL path for directFB on Linux differs from x11 path
* 2017-08-14 SDL2: DirectFB linux_input disabled by default
* 2017-08-03 Alpine: add consolekit2
* 2017-07-21 abuild: -D parameter for alternative description
* 2017-07-07 Alpine: busybox-extras with telnetd enabled
* 2017-05-23 weston: instead of less than 1 Hz use default refresh rate
=== Not started, but should/could be done in the future ===
* abuild: Add a compression flag to override the default of highest compression (right now we install a wrapper that converts -9 to -1 to improve performance)
=== Related ===
* ~postmarketos/upstreaming mailing list, for all the kernel related upstreaming
Category:Technical Reference
Using ebook reader hardware

= Introduction =
This document is meant to be a starting point for using e-book readers (ie. Kobo devices, Pine64 Pinenote, etc.) with postmarketOS, from perspective of an end user.
== Basic considerations ==
=== Avoid animations ===
* e.g. blinking cursors in text console: /sys/class/graphics/fbcon/cursor_blink
=== Back(really Front-)light ===
* UIs might consider enabled light to be a requirement for using the device, so it might be unnecessarily enabled and drain your battery
== Desktop environments support ==
=== GNOME ===
TODO
e-ink theme for Gnome Shell
=== Plasma ===
TODO
e-ink theme
=== SXMO ===
* Create a device profile
* Add DPI in ~/.Xresources ie:
 Xft.dpi: 350
* Change rotation permanently - add to ~/.config/sxmo/profile
 xrandr -o left
* You will also need to set 'Coordinate Transformation Matrix' - can be googled easily for xinput instruction, or see https://github.com/bjesus/air readme for a Xorg configuration file example
* Note - this seems to leave SXMO default gestures bindings, as they worked before rotation - the right edge is treated like it was top, and swiping it shows the menu, etc.
=== Other ===
AIR - custom scripts, based on AwesomeWM (X11)
* matchbox
== Software ==
=== Navigation ===
If you not just want to look around on maps, you can attach some gps over bluetooth or usb-host (maybe via bluetooth dongle) or the second serial port available on
several kobos and tolinos. If you use routing, not updating the map away from decision points might be helpful.
* Navit - routing, finding POIs
* Some maps from state agencies are quite nice and grayscale mode (Lantmateriet Sweden offers some maps under a C0 license)
* standard OSM mapnik needs some high contrast tweaking
=== e-book readers ===
* Foliate
* KOReader
* Inkbox
* ...
VNC

This guide explains how to setup a VNC server on your phone.
== x11vnc ==
Using , which is in the Alpine repos. You need a running X server (e.g. running Xfce), then you just run x11vnc on the device in a terminal/tty and connect to it. From there, you can manipulate the previously running X server. You might need to specify the X server if x11vnc does not detect it (e.g. by passing -display :0 to it or doing a export DISPLAY=:0 before running it, assuming the display is at :0)
If you want to launch x11vnc from ssh while you have already logged in from the display managers of your choice, you need to find the Xauthority file for the logged in user and use that in the command of x11vnc, for example, if your user id is 10000 and you're using gdm:
x11vnc -auth /run/user/10000/gdm/Xauthority -display :0
Location of Xauthority file may differ with different display manager.
== wayvnc ==
This works for wlroots-based Wayland compositors like Phosh or SwayVNC on PinePhone (how to). By default wayvnc listens to 127.0.0.1:5900
Install , and start a server listening to any network interface on the phone:
$ sudo apk add wayvnc
(1/3) Installing aml (0.2.1-r0)
(2/3) Installing neatvnc (0.4.0-r0)
(3/3) Installing wayvnc (0.4.1-r0)
Executing busybox-1.35.0-r13.trigger
OK: 971 MiB in 563 packages
$ wayvnc 0.0.0.0
Or listen to 172.16.42.1 on port 9999:
$ wayvnc 172.16.42.1 9999
After a server setup, use a client, for example, to connect to the server 172.16.42.1:9999, and press :
Have fun with it.
== Troubleshooting ==
=== XDG_RUNTIME_DIR not set in the environment ===
This happens when XDG_RUNTIME_DIR is not set, usually in SSH sessions.
$ wayvnc 0.0.0.0
error: XDG_RUNTIME_DIR not set in the environment.
ERROR: Failed to initialise wayland
Just set it with:
$ export XDG_RUNTIME_DIR=/run/user/10000
And start the server again.
=== Connection refused/timed out ===
Check if your VNC server is started, and the port is open to the clients.
By default, incoming packets from USB Networking are accepted by nftables on the phone postmarketos-config-nftables rules.
But when connecting via Wi-Fi, you need to open the port.
If using port 5900, it's as simple as installing and restarting nftables:
# apk add postmarketos-config-nftables-vncserver
(1/1) Installing postmarketos-config-nftables-vncserver (0.10-r0)
Executing postmarketos-base-20-r0.trigger
Configuring a getty on port ttyMSM0 with baud rate 115200
OK: 1006 MiB in 570 packages
# service nftables restart
 * Stopping firewall ... [ ok ]
 * Loading nftables state and starting firewall ...
However, when connecting to a custom port like 9999, it requires to add a rule to accept the connection:
# nft add rule inet filter input iifname wlan0 tcp dport 9999 accept comment "Accept custom port over wifi"
=== No route to host ===
Check if the host even exists on the LAN.
== Related pages ==
DIAL
== See also ==
* Side Displays, Using a Linux phone as a secondary monitor by User:R
* VNC Server for Pinephone
* Is remote desktop making a come­back in GNOME on Wayland?
== References ==
Category:Guide