Tips and tricks: Difference between revisions
LongnoseRob (talk | contribs) update to gitlab.postmarketos.org |
|||
(24 intermediate revisions by 15 users not shown) | |||
Line 9: | Line 9: | ||
{{note|'''Warning''': Ignoring host keys could leave you vulnerable to a [https://en.wikipedia.org/wiki/Man-in-the-middle_attack Man-in-the-middle attack]}} | {{note|'''Warning''': Ignoring host keys could leave you vulnerable to a [https://en.wikipedia.org/wiki/Man-in-the-middle_attack Man-in-the-middle attack]}} | ||
=== SSH with Suckless Terminal === | |||
When you ssh into postmarktetos using the suckless terminal (st) on your host, you will get errors with vim: | |||
<syntaxhighlight lang="text"> | |||
E558: Terminal entry not found in terminfo | |||
'st' not known. Available builtin terminals are: | |||
builtin_amiga | |||
</syntaxhighlight> | |||
Furthermore, gpg will refuse to decrypt files and return the following error: | |||
<syntaxhighlight lang="text"> | |||
gpg: public key decryption failed: Required environment variable not set | |||
gpg: decryption failed: No secret key | |||
</syntaxhighlight> | |||
To fix, simply add <code>export TERM=xterm</code> to your <code>~/.profile</code> file on your postmarketos phone. | |||
=== Some interesting ideas === | === Some interesting ideas === | ||
Here are some interesting ideas that you can do with your device with postmarketOS | Here are some interesting ideas that you can do with your device with postmarketOS | ||
* Use it as a mini retro handheld gaming device. As there are many good retro | * Use it as a mini retro handheld gaming device. As there are many good retro emulators that can make your device one great gaming device. | ||
* Use it as a mini penetration testing device. As postmarketOS is a pure linux os, you can run [https://en.wikipedia.org/wiki/Wireshark Wireshark] and other penetration testing software with it. | * Use it as a mini penetration testing device. As postmarketOS is a pure linux os, you can run [https://en.wikipedia.org/wiki/Wireshark Wireshark] and other penetration testing software with it. | ||
* You can run full Desktop Environment, with [https://en.wikipedia.org/wiki/Inkscape Inkscape], [https://en.wikipedia.org/wiki/GIMP GIMP] and full | * You can run full Desktop Environment, with [https://en.wikipedia.org/wiki/Inkscape Inkscape], [https://en.wikipedia.org/wiki/GIMP GIMP] and full <abbr title="not mobile version">desktop</abbr> browser with extensions in your device, . | ||
=== VNC | === [[VNC]] === | ||
Using x11vnc, which is in the Alpine repos. You need a running X server (e.g. running | Using x11vnc, 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) | 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) | ||
=== Update the architecture of your device === | === Update the architecture of your device === | ||
Some devices have the armhf-architecture but the device supports armv7. Some | Some devices have the armhf-architecture but the device supports armv7/aarch64. Some packages can not be built for armhf, so it is useful to update the architecture. {{note|While updating armhf -> armv7 is usually trivial, armhf/armv7 -> aarch64 is usually not. See [https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/599#note_486220044 here]}} | ||
==== from armhf to armv7 ==== | |||
* Update the architecture in the following files: | * Update the architecture in the following files: | ||
< | <syntaxhighlight lang=text> | ||
device/device- | device/testing/device-wiki-example/APKBUILD | ||
device/device- | device/testing/device-wiki-example/deviceinfo | ||
device/linux- | device/testing/linux-wiki-example/APKBUILD | ||
</ | device/testing/firmware-wiki-example/APKBUILD | ||
</syntaxhighlight> | |||
* Update the name of the config-wiki-example.armhf in device/linux-wiki-example | * Update the name of the config-wiki-example.armhf in device/linux-wiki-example to config-wiki-example.armv7 | ||
* Create new | * Create new checksums for the device package <code>pmbootstrap checksum device-wiki-example</code> as well as for the kernel package <code>pmbootstrap checksum linux-wiki-example</code>, <code>pmbootstrap zap</code>, and reinstall. | ||
Due to CI-Updates in the Gitlab-repository it may be necessary to also [[Downstream_kernel_specific_package#Modernize_your_aport|modernize your aport]] before you can [[Git_workflow|upstream your work]]. | Due to CI-Updates in the Gitlab-repository it may be necessary to also [[Downstream_kernel_specific_package#Modernize_your_aport|modernize your aport]] before you can [[Git_workflow|upstream your work]]. | ||
=== Misc === | === Misc === | ||
* The splash screen is [https:// | * The splash screen is [https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/206 highly configurable] (scroll down for an example)! | ||
* Browse the Linux source with links to all references [http://elixir.free-electrons.com here] | * Browse the Linux source with links to all references [http://elixir.free-electrons.com here] | ||
* Qualcomm and maybe some other Androids can simply reboot from postmarketOS (or any Linux distro) into your bootloader or recovery with <code>reboot -f bootloader</code> and <code>reboot -f recovery</code> | * Qualcomm and maybe some other Androids can simply reboot from postmarketOS (or any Linux distro) into your bootloader or recovery with <code>reboot -f bootloader</code> and <code>reboot -f recovery</code> | ||
Line 43: | Line 62: | ||
=== Copy a port === | === Copy a port === | ||
If you know a port of another device | If you know a port of another device works on your device too, you can copy the port. | ||
Reasons for copying a port: | |||
* You cannot make your device | * You cannot make your device boot yourself, or you want to save the time it takes to do it | ||
* There are no kernel sources available for your device | * There are no kernel sources available for your device | ||
* The devices are very similar (e.g. same SoC), but | * The devices are very similar (e.g. same SoC), but need small adjustments | ||
Keep in mind that if you copy a port you | Keep in mind that if you copy a port, you copy all the problems and bugs as well. For example, it can be better to create a new up-to-date port than to copy a port which only compiles under gcc6 and still uses armhf. | ||
If you want to copy the port of a device, copy all the files of the device in your device-folder and rename them to the new ones. | If you want to copy the port of a device, copy all the files of the device in your device-folder and rename them to the new ones. Then simply follow the porting guide. If the config-file of your new device is available, try to use it instead of the old one. | ||
[[Category:Guide]] | [[Category:Guide]] |
Latest revision as of 06:46, 3 November 2024
SSH Config
When postmarketOS is reinstalled, a new ssh host key will be generated. Your SSH client will detect this, and refuse to connect, requiring you to run ssh-keygen -R 172.16.42.1
each time a new host key is generated.
To disable this check, and to allow you to connect by running ssh postmarketos
, add the following to your ~/.ssh/config
:
Host postmarketos HostName 172.16.42.1 StrictHostKeyChecking no UserKnownHostsFile=/dev/null
Warning: Ignoring host keys could leave you vulnerable to a Man-in-the-middle attack |
SSH with Suckless Terminal
When you ssh into postmarktetos using the suckless terminal (st) on your host, you will get errors with vim:
E558: Terminal entry not found in terminfo
'st' not known. Available builtin terminals are:
builtin_amiga
Furthermore, gpg will refuse to decrypt files and return the following error:
gpg: public key decryption failed: Required environment variable not set
gpg: decryption failed: No secret key
To fix, simply add export TERM=xterm
to your ~/.profile
file on your postmarketos phone.
Some interesting ideas
Here are some interesting ideas that you can do with your device with postmarketOS
- Use it as a mini retro handheld gaming device. As there are many good retro emulators that can make your device one great gaming device.
- Use it as a mini penetration testing device. As postmarketOS is a pure linux os, you can run Wireshark and other penetration testing software with it.
- You can run full Desktop Environment, with Inkscape, GIMP and full desktop browser with extensions in your device, .
VNC
Using x11vnc, 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)
Update the architecture of your device
Some devices have the armhf-architecture but the device supports armv7/aarch64. Some packages can not be built for armhf, so it is useful to update the architecture.
While updating armhf -> armv7 is usually trivial, armhf/armv7 -> aarch64 is usually not. See here |
from armhf to armv7
- Update the architecture in the following files:
device/testing/device-wiki-example/APKBUILD
device/testing/device-wiki-example/deviceinfo
device/testing/linux-wiki-example/APKBUILD
device/testing/firmware-wiki-example/APKBUILD
- Update the name of the config-wiki-example.armhf in device/linux-wiki-example to config-wiki-example.armv7
- Create new checksums for the device package
pmbootstrap checksum device-wiki-example
as well as for the kernel packagepmbootstrap checksum linux-wiki-example
,pmbootstrap zap
, and reinstall.
Due to CI-Updates in the Gitlab-repository it may be necessary to also modernize your aport before you can upstream your work.
Misc
- The splash screen is highly configurable (scroll down for an example)!
- Browse the Linux source with links to all references here
- Qualcomm and maybe some other Androids can simply reboot from postmarketOS (or any Linux distro) into your bootloader or recovery with
reboot -f bootloader
andreboot -f recovery
- Battery capacity can be monitored to trigger low battery actions. See Battery capacity monitoring for more information.
Copy a port
If you know a port of another device works on your device too, you can copy the port.
Reasons for copying a port:
- You cannot make your device boot yourself, or you want to save the time it takes to do it
- There are no kernel sources available for your device
- The devices are very similar (e.g. same SoC), but need small adjustments
Keep in mind that if you copy a port, you copy all the problems and bugs as well. For example, it can be better to create a new up-to-date port than to copy a port which only compiles under gcc6 and still uses armhf.
If you want to copy the port of a device, copy all the files of the device in your device-folder and rename them to the new ones. Then simply follow the porting guide. If the config-file of your new device is available, try to use it instead of the old one.