Changes

Jump to navigation Jump to search
= Changing the kernel configuration =
 You can change the kernel configuration with pmbootstrap. On some devices the naming convention is simply linux-<vendor>-<device>, for the linux-sony-yuga package for example we run:
<pre class="shell">pmbootstrap kconfig edit sony-yuga</pre>
 
Some devices do not follow this naming convention, in which case you can check what package provided the kernel by running:
 
<pre class="shell">apk info --who-owns /boot/vmlinuz-*</pre>
 
On the pinephone by pine64 you would run:
 
<pre class="shell">pmbootstrap kconfig edit linux-postmarketos-allwinner-5.4.0_git20191204-r1</pre>
This gives you a menu where you can select and deselect all kernel configuration options. Press the <code>/</code> key to get a search dialog. After finding something, type the number of the search result to quickly jump to it.
<pre>PTY allocation request failed on channel 0
-ash: a: unknown operand</pre>
 
=== CONFIG_TMPFS_POSIX_ACL ===
 
''' About'''
 
''Support POSIX Access Control Lists (ACLs) for tmpfs-based filesystems.''
 
[https://cateee.net/lkddb/web-lkddb/TMPFS_POSIX_ACL.html Read more...]
 
'''pmOS specific'''
 
This is needed for some UIs (phosh) to be able to control bluetooth.
=== CONFIG_VT ===
Device Drivers -->
Character Devices -->
Enable TTY --> Virtual Terminal
</pre>
This should always be set since pmbootstrap creates an ext4 rootfs.
 
=== CONFIG_UEVENT_HELPER ===
 
'''About'''
 
''The uevent helper program is forked by the kernel for every uevent. Before the switch to the netlink-based uevent source, this was used to hook hotplug scripts into kernel device events. It usually pointed to a shell script at /sbin/hotplug. This should not be used today, because usual systems create many events at bootup or device discovery in a very short time frame. One forked process per event can create so many processes that it creates a high system load, or on smaller systems it is known to create out-of-memory situations during bootup.''
 
[https://cateee.net/lkddb/web-lkddb/UEVENT_HELPER.html Read more...]
 
'''Location in menu'''
 
<pre class="shell">
Device Drivers -->
Generic Driver Options -->
Support for uevent helper
</pre>
 
'''pmOS specific'''
 
This option should always be enabled on pmos kernels that are 3.16+, it's the config option that makes /proc/sys/kernel/hotplug appear.
=== CONFIG_KERNEL_GZIP, CONFIG_KERNEL_XZ, CONFIG_KERNEL_LZO and CONFIG_KERNEL_LZMA ===
Please disable it, so we have one less source of failure.
=== CONFIG_KINETO_GAN ===
 
'''About'''
 
''Related to a proprietary "T-Mobile's WiFi-Calling" feature. It should not affect normal calls, so it should be safe to disable it.''
 
'''Location in menu'''
 
<pre class="shell">
Device Drivers -->
Network device support -->
Kineto GAN virtual network interface
</pre>
 
'''pmOS specific'''
 
Causes <code>sudo</code>, <code>ip</code> and other commands to hang ({{issue|1513|pmbootstrap}}). Please disable it.
 
=== CONFIG_BLK_DEV_INITRD ===
 
'''About'''
 
''Initial RAM filesystem and RAM disk (initramfs/initrd) support''
 
'''Location in menu'''
 
<pre class="shell">
General setup -->
Initial RAM filesystem and RAM disk (initramfs/initrd) support
</pre>
 
'''pmOS specific'''
 
Required. See {{issue|237|pmaports}} for notes about changing the initramfs compression.
 
=== CONFIG_CGROUPS ===
 
'''About'''
 
''This option adds support for grouping sets of processes together, for use with process control subsystems such as Cpusets, CFS, memory controls or device isolation.''
 
[https://cateee.net/lkddb/web-lkddb/CGROUPS.html Read more...]
 
'''Location in menu'''
 
<pre class="shell">
General setup -->
Control Group support
</pre>
 
'''pmOS specific'''
 
Required for elogind, and therefore necessary to be able to run most desktop environments.
 
=== CONFIG_CRYPTO_XTS ===
 
'''About'''
 
''XTS: IEEE1619/D16 narrow block cipher''
 
[https://cateee.net/lkddb/web-lkddb/CRYPTO_XTS.html Read more...]
 
'''Location in menu'''
 
<pre class="shell">
Cryptographic API -->
XTS support
</pre>
 
'''pmOS specific'''
 
Needed for the default cryptsetup cipher in pmbootstrap (<code>aes-xts-plain64</code>) ({{issue|1940}})
 
=== CONFIG_SAMSUNG_TUI ===
 
'''About'''
 
''Provide methods for TUI such as acquisition of buffer to be used as secure frame buffer in Secure World and synchronization of display and touch device between Normal World and Secure World.''
 
'''Location in menu'''
 
<pre class="shell">
Device Drivers -->
Misc devices -->
TUI HW Handler
</pre>
 
'''pmOS specific'''
 
Needs to be disabled. Prevents device from booting.
 
=== CONFIG_SEC_RESTRICT_ROOTING ===
 
'''About'''
 
''Restrict unauthorized executions with root permission.''
 
'''Location in menu'''
 
<pre class="shell">
Kernel hacking -->
Samsung Rooting Restriction Feature
</pre>
 
'''pmOS specific'''
 
Needs to be disabled. Blocks user from gaining root permissions.
 
=== CONFIG_TZDEV ===
 
'''About'''
 
''Samsung TZ Based Secure OS interface driver''
 
'''Location in menu'''
 
<pre class="shell">
Device Drivers -->
Misc devices -->
Samsung TZ Based Secure OS Support
</pre>
 
'''pmOS specific'''
 
Needs to be disabled. Prevents device from booting.
== Optional ==
'''pmOS specific'''
This is recommended for all 32bit (armhf, armv7, x86) devices. The option is not present on 64bit (aarch64, x86_64) devices.
Without this option, it is not possible to mount ext4 partitions that have been created with the default settings. The postmarketOS SD card installation uses these default parameters. There doesn't seem to be a point in changing that to work around badly configured kernels: even if the postmarketOS installation did not require this option, you might come across an SD card with ext4, that does not work on your device.
No
 
=== CONFIG_FHANDLE ===
 
'''About'''
 
''open by fhandle syscalls''
 
'''Location in menu'''
 
<pre class="shell">
General setup -->
open by fhandle syscalls
</pre>
 
'''pmOS specific'''
 
If USB OTG isn't working for you, try enable this config.
=== CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE ===
Set this if your device needs an appended device tree. If you are unsure, use <code>extract-dtb</code> on an existing kernel image. Not to be confused with <code>CONFIG_ARM_APPENDED_DTB</code>!
= Automatically merging == CONFIG_FW_LOADER_USER_HELPER ==='''About''' ''Enable the firmware sysfs fallback mechanism found in drivers/base/firmware_loader/Kconfig'' '''Location in menu''' <pre class="shell>Device Drivers --> Generic Driver Options --> Firmware loader --> Firmware loading facility (FW_LOADER [=y]) --> Enable the firmware sysfs fallback mechanism</pre> '''pmOS specific''' Prior to kernel version 3.7, the kernel had no capability of finding firmware itself so it had to call out to userspace to find the firmware for it. This changed with kernel configuration =3.7 where the kernel gained "direct loading support" and where the userspace helper was only called as a fallback. In kernel 3.9 this functionality was put behind the kconfig option FW_LOADER_USER_HELPER which is what this patch checks to be enabled. Use Without this scriptoption, the udev rule present in postmarketos-base won't be notified that firmware needs to be loaded and as such can't call firmwareload.sh which loads firmware from /lib/firmware/postmarketos. === CONFIG_KEY_DH_OPERATIONS & CONFIG_CRYPTO_DH & CONFIG_CRYPTO_DES & CONFIG_CRYPTO_USER_API_SKCIPHER=== '''About''' ''These options enables ability to use iwd daemon (wpa_supplicant replacement)'' '''Location in menu''' <pre class="shell>Security Options ---> [*] Enable access key retention support [*] Diffie-Hellman operations on retained keys Cryptographic API ---> [*] Diffie-Hellman algorithm [*] DES and Triple DES EDE cipher algorithms [*] User-space interface for symmetric key cipher algorithms</pre> and these<pre class="shell> CONFIG_CRYPTO_USER_API_HASH CONFIG_CRYPTO_ECB CONFIG_CRYPTO_MD4 CONFIG_CRYPTO_MD5 CONFIG_CRYPTO_CBC CONFIG_CRYPTO_SHA1 CONFIG_CRYPTO_SHA256 CONFIG_CRYPTO_SHA512 CONFIG_CRYPTO_AES CONFIG_CRYPTO_DES CONFIG_CRYPTO_CMAC CONFIG_CRYPTO_HMAC CONFIG_CRYPTO_ARC4</pre>'''pmOS specific'''Enable only on recent mainline kernels. After enabling these options, you can use iwd daemon (better performance) instead of wpa_supplicant. === CONFIG_USER_NS ==='''About''' ''User namespace'' ''Required for BubbleWrap sandboxing used by The GNOME Web (Epiphany) and other software.'' '''pmOS specific''' Phosh environment must have it enabled for Web browser (Epiphany) being functional. '''Location in menu''' <pre class="shell>General setup ---> Namespaces support ---> [*] User namespace</pre> === SECCOMP ==='''About''' ''Enable seccomp to safely compute untrusted bytecode'' ''Required for BubbleWrap sandboxing used by The GNOME Web (Epiphany) and other software.'' '''pmOS specific''' Phosh environment must have it enabled for Web browser (Epiphany) being functional. == Anbox == To enable Anbox support, some options are required === CONFIG_SQUASHFS === '''About''' ''Squashfs is a highly compressed read-only filesystem for Linux. It uses zlib, lzo or xz compression to compress both files, inodes and directories. squashfs is intended for general read-only filesystem use, for archival use (i.e. in cases where a .tar.gz file may be used), and in embedded systems where low overhead is needed.'' '''Anbox specific''' Anbox uses a squashfs to store the Android rootfs. === CONFIG_SQUASHFS_XZ === '''About''' ''Squashfs support for reading squashfs file systems compressed with XZ compression. XZ gives better compression than the default zlib compression, at the expense of greater CPU and memory overhead.'' '''Anbox specific''' Anbox uses a ''xz-compressed'' squashfs. === CONFIG_SQUASHFS_XATTR === '''About''' ''Squashfs support for extended attributes (xattrs). Xattrs are name:value pairs associated with inodes by the kernel or by users (see the [https://www.systutorials.com/docs/linux/man/5-attr/ attr(5)] manual page).'' '''Anbox specific''' For some reason, even if the squashfs is created with <code>-no-xattrs</code>,Anbox seems to fail badly without. === CONFIG_ASHMEM === '''About''' ''The ashmem subsystem is a new shared memory allocator, similar to POSIX SHM but with different behavior and sporting a simpler file-based API.'' ''It is, in theory, a good memory allocator for low-memory devices, because it can discard shared memory units when under memory pressure.'' '''Anbox specific''' Android requires it, so you need it to run Anbox. === CONFIG_BINDER_IPC === '''About''' ''Binder is used in Android for both communication between processes and remote method invocation. This means one Android process can call a method/routine in another Android process, using Binder to identify, invoke and pass arguments between said processes.'' '''Anbox specific''' Android uses it to communicate between process. It must be present for Anbox to work. === CONFIG_BINDERFS === '''About''' ''Binderfs is a pseudo-filesystem for the Android Binder IPC driver which can be mounted per-ipc namespace allowing to run multiple instances of Android. Each binderfs mount initially only contains a binder-control device. It can be used to dynamically allocate new binder IPC devices via ioctls.'' '''Anbox-on-postmarketOS specific''' It should '''not''' be set, because binderfs support in Anbox is broken in postmarketOS. For now, we just use regular binder instead because we don't need several binders. It could be an incompatibility with musl. In <code>sys/ioctl.h</code>, the ioctl function is prototyped as such: <code>int ioctl(int, int, ...);</code>, in accordance to POSIX. On the kernel sourcehand, in the linux programmer manual, ioctl is of type <code>int ioctl(int, unsigned long, ...);</code>. GCC warns about it: "Warning:overflow in conversion from 'long unsigned int' to 'int' change value from 3238552065 to -1056415231", but according to dalias on #musl it should be harmless. === CONFIG_ANDROID_BINDER_DEVICES === '''About''' ''Default value for the binder.devices parameter. The binder.devices parameter is a comma-separated list of strings that specifies the names of the binder device nodes that will be created. Each binder device has its own context manager, and is therefore logically separated from the other devices.'' '''Anbox specific''' This must contain <code>binder</code>, as Anbox expects <code>/dev/binder</code>. It should also contain <code>hwbinder</scriptscode> to be future-proof (as it will be required for Android 10). === CONFIG_TMPFS_XATTR === '''About''' Xattr support for tmpfs. '''Anbox specific''' Android requires it because it sets xattr on files in /kconfigdev, which is a tmpfs. Otherwise you get errors such as this in <code>/var/lib/anbox/console.log</code> :  libc: fsetxattr failed to set context (u:object_r:dalvik_prop:s0) for "/dev/__properties__/u:object_r:dalvik_prop:s0" libc: fsetxattr failed to set context (u:object_r:config_prop:s0) for "/dev/__properties__/merge_configu:object_r:config_prop:s0" === NETFILTER_XT_MATCH_COMMENT === '''About''' It allows putting comments in iptables rules.shIt's a dummy module that ignore its <code>--comment=</code>argument. depends on NETFILTER, NETFILTER_XTABLES and NETFILTER_ADVANCED. '''pmOS specific''' It is a requirement of anbox-bridge.sh, which we use in the openRC init script. Anbox won't start without that.
= See also =
439

edits

Navigation menu