- use amove instead of installing to subpackages from main package
- for selecting pixman renderer usage in wlroots, users testing
wlroots0.19-based UIs can just install 0.20 manually to pull in the
configuration, which will also work on 0.19.
Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/9159>
Comply with pmOS, which prefers to store hwdb in /etc. openrc works
differently, or at least the packaging in pmOS/Alpine does, so manually
recompile hwdb at package installation time in that case.
Fixes: a99f680468 ("device-blackberry-key2-generic: additional unl0kr fixes")
Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/9335>
- switch to pactl for volume adjustment since we now have UCM2 and can
use pulseaudio natively
- modify screenlock to prevent false activity causing screen to remain
turned on indefinitely
- set swapfile to 220M to reduce likelihood of thrashing
- switch zram algorithm to lz4, which might have even better performance
on N900 than lzo-rle
Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/9107>
1. Use udev's uaccess tag mechanism to permit unprivileged access to the
gpio_keys input device which reports EV_SW events such as SW_KEYPAD_SLIDE.
Thus the user can interact with the keypad slide switch under X11 without
needing to be in the input group. Do the same for the power button, even
though X11 can read it directly.
2. Drop acpid and related configurations. This removes the dependency on user
being in the input group.
3. Switch to the logind SetBrightness API to control the keyboard LEDs
without requiring elevated permissions. brightnessctl as packaged under
Alpine currently depends on the user being in the input group to control
LEDs.
4. Improve the keyboard backlighting so it is more even, by setting higher values
of brightness for the innermost keyboard backlight LEDs.
5. Simplify the touchscreen calibration rules and merge with the rules for
gpio_keys and power button.
Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8748>
For seamless systemd support:
1. Fix sway locking script. systemd adds more paths under /run/user, which
interfere with `find`. Limiting the search depth works around the issue
2. Only force load `nokia-modem` driver under openrc. With systemd, force-
loading the driver appears to confuse systemd-udevd during boot, causing
long boot times and even total failure. On the running system, the driver
also causes systemd-udevd to become unstable. Until the issue is resolved
(probably in the driver), there will not be any modem support when using
systemd
3. Remove the isp1704 driver (for the PHY) from the initramfs. Under systemd,
it might load too early and fail, leading to slow charging in the running
system. It is more reliable when loaded later on. Charging still works in
the initramfs since the actual charger driver (bq2415x) is available
Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8612>
In addition to the version upgrade:
1. Drop DTS patch for volume keys. These will be handled via hwdb
2. Drop CONFIG_FW_LOADER_USER_HELPER. It was required by the LED controller
(lp5523) driver until Linux 6.19
3. Restore TWL4030_PWRBUTTON, and make it built-in (in readiness for plymouth)
4. Drop HSI patch. To be replaced with a better quality patch which will be
upstreamed
5. The remainder of changes are from kconfig migrate
Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8471>
1. Modernize the boot parameters uboot passes to the kernel
2. Correct the volume keys. Upstream DTS actually sends F7 and F8 for these
keys, which is the behavior from stock. Using hwdb to correct the keys
allows us to drop the relevant DTS patch from linux-postmarketos-omap.
Additionally add the hwdb database into initramfs to ensure the keys
also work during system initialization
3. Disable OMAP 3430 OFF mode early in the initramfs. This is currently
broken and causes system instability. We previously used a DTS patch to
do this, but using an initramfs hook allows us to reduce the amount of
kernel patches we maintain
Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8472>
Version 34 of the device-nokia-n900 package implemented an udev-based script
for shutdown due to critically-low battery condition. Therefore, depending on
UPower is no longer necessary. To keep the i3blocks status bar working in
the absence of UPower, switch back to basic sysfs polling.
Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8472>
As of upower 1.91.0, UPower supports config fragments, thus there is no longer
a need to ship a full UPower.conf. The device-specific upower package can
therefore be dropped, and the config fragment will be installed unconditionally
as part of the device package.
NB: It is still necessary to use a custom udev script to initiate poweroff due
to low battery on the N900, since the fuel gauge has a hardware limitation
which results in reporting 0% if the calibration is off, causing unwanted
device shutdowns if UPower's mechanism is active.
Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8472>
Provide a unified screen locking mechanism, supporting x11 and sway. Auto
locking is also improved to correctly disable inputs in all screen locking
scenarios, and re-enabling them on unlock. Unlock on keypad slide now also
works on sway (from sway v1.12).
Any x11 UI can use the existing script by setting up appropriate keybinds to
the script and autostarting xautolock. It may be necessary to disable any
built-in autolock method integrated within a specific x11 WM.
NB: This is NOT locking in the sense of secure locking. It is purely for
turning the screen off and disabling some inputs (currently only the
touchscreen) to prevent unintended wakeups.
Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8472>
Running the service for wl1251-cal before udev is partly responsible for very
slow boot observed on the N900 when using systemd. This is likely because of
the dependency on /lib/firmware.
Provide the NVS in /run instead, an idea borrowed from msm-firmware-loader. It
is safe to permanently overwrite the user-defined firmware search path since
the N900 does not need firmware that would be expected to be in
/lib/firmware/postmarketos.
Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7234>
Since /lib/firmware is always mounted as soon as / is mounted, wl1251-cal can
still be effective without the module blacklist, as long as care is taken to
ensure the service runs as soon as possible, and strictly before udev starts.
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6943>
1. Relocate the WLR_BACKEND environment variable away from sway subpackage to
enable its use on other wlroots compositors. Install this for any wayland
environment, even though it is only useful under wlroots. However, there are
currently many wlroots versions in Alpine to come up with a sane install_if
directive.
2. Add the USB PHY driver (isp1704) to the initramfs to allow the charger
driver to autodetect the charger type and pull higher current as needed.
Improves upon e040fa5e51 ("device-nokia-n900: initfs: add charger driver")).
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6908
apk-tools has a bug in connection with handling symlink in some scenarios,
which is an issue for xkeyboard-config, which installs a symlink since version
2.45. implement Alpine workaround until apk-tools is fixed.
Fixes: 5edf40fbe9 ("xkeyboard-config: upgrade to latest upstream")
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6891
[ci:skip-build]: already built successfully in CI
Notes:
* In general, keybindings are similar to the existing i3 configuration for
the Nokia N900
* Power key and lock switch enable/disable the screen
* The keypad is always lit (dimly) when the screen/touch are active and is
turned off at other times
* The font can be increased/decreased in foot with Ctrl+Up/Down arrow
* The status uses the configuration and feed generator from i3 (i3blocks)
* After two minutes of idle, the screen and touch sensor will be disabled
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6714
[ci:skip-build]: already built successfully in CI
These devices have DRM through the omapdrm kernel driver in mainline.
However, they do not have GPU acceleration, so programs/stacks requiring
GL(ES) will not work. sway and other wlroots-based stacks work well when
WLR_RENDERER=pixman is set.
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6714
1. dependencies useful for all X11 DEs/WMs moved to x11 subpackage
2. add dmenu-based power key menu with options for shutdown, reboot, and
screenshot
3. handle power and screenlock keys using i3 directly, instead of acpi/evtest
4. add mouse key emulation via Shift+keyboard-keys
[ci:skip-build]: already built successfully in CI
Reverts 82a8d55197 (device-nokia-n900: drop partition resize cmdline option
(MR 6164)) since it seems resizing does not actually take place automatically,
at least as far as the N900 is concerned
[ci:skip-build]: already built successfully in CI
Alpine now ships compressed firmware, so the old firmware file name is no
longer available, causing wl1251-cal to fail. Fix by manually creating the
expected uncompressed file.
Additionally, wl1251-cal has not been running early enough in most cases,
causing the kernel to use default nvs. Fix by blacklisting the driver and
probing it after the correct nvs has been extracted and saved.
[ci:skip-build]: already built successfully in CI
Drop all uses of the /etc/skel feature for adding configuration files and
scripts to the user's $HOME. Files installed via /etc/skel are outside the
control of the package manager and may result in broken installations. At the
least, they are not updateable from the packaging.
To implement this:
* drop $HOME/.protip_shell.sh, whose usefulness is questionable
* relocate i3blocks blocklets to /usr/share, and the config file to /etc/xdg,
which is an i3blocks' standard search path (`man i3blocks`)
* move the i3 configuration file to /etc/xdg, from where it can be picked up
and included by the config file provided via postmarketos-ui-i3wm. Configs
from $HOME are still parsed, and will be honored by i3wm, subject to i3's
limitations in connection with including extra config files
* at i3 startup, with the help of an external script, ensure there is an i3
config file in $HOME, even if empty. This prevents i3-config-wizard from
running and mangling the config files
* convert xdefaults to Xresources and store in /usr/share/X11. Load it to on
the environment by calling `xrdb` during i3 startup
lock.sh is only reliable when used with i3wm, where we disable gpio_keys from
being handled by X/i3wm. When this is not done (e.g. when testing a different
X11 UI), the script becomes unreliable since the display turns on due to the
SCREENLOCK key being toggled, and therefore only the display=on case is ever
run.
Improve reliability of the script by basing the decision making on the
enabled/disabled state of the touchscreen instead.
As of upower 1.90.5, it is possible to configure upower to not take an action
when the battery capacity is reported as critically low. Since the Nokia N900
now monitors its battery capacity using udev scripts, which is more accurate
than upower's calculation, enable the new ignore feature for the N900.
The bq27200 fuel gauge depends on its battery-backed memory for capacity
reporting. If the supply is off for some time, the fuel gauge's last known
capacity is reset, after which a capacity value can only be read after a
full charge cycle. Thus, most of the time, as used on the Nokia N900, the
reported percentage cannot be relied on for making power-off decisions on
battery low conditions, e.g. through UPower.
However the fuel gauge can very accurately detect and report a low battery
condition internally, even if the reported capacity is incorrect, e.g. when
it has been reset. The low battery condition is reported by the kernel via
capacity_level in sysfs, and also generates uevents.
So we can implement safe battery shutdown by requesting the kernel to more
regularly polling for status changes, then performing an immediate shutdown
when the capacity_level is reported as Low and the device is not charging.
The deviceprofile is now in a tagged sxmo release.
The conky issue will be mentioned in wiki for users to manually disable, until
upstream allows toggling it.
bq27xxx_battery has a check for status flags in order to detect changes
and report to userspace. However, the cached flags are updated before
checking for changes, hence no flag-related events are ever sent. This
patch fixes this behavior, and has been sent upstream.
[ci:skip-build]: already built successfully in CI
upstream erroneously dropped N900 configuration in xkeyboard-config 2.42. until
this is fixed upstream, fork the package. set it to build only for armv7 to
reduce any possible effect on other devices in pmos.
Closes: https://gitlab.com/postmarketOS/pmaports/-/issues/2923
[ci:skip-build]: already built successfully in CI
* drop maxcpus=0, which was added with 73a033328e ("device-nokia-n900: set
uniprocessor mode for kernel (MR 4299)") while troubleshooting. a better
fix was eventually implemented with 3e737241ba ("linux-postmarketos-omap:
N900: disable twl off idle features (MR 4317)")
* drop PMOS_NO_OUTPUT_REDIRECT, which was obsoleted by 7c98127746
("postmarketos-initramfs: switch to udev and kmod (MR 5000)")
commit 933f2b5703 ("device-nokia-n900: improve sxmo-dwm support [MR 5227]")
accidentally removed sxmo lock state initialization. Restore the lock state
initialization
170189393b (device-nokia-n900: add upower support and config (MR 4397) added
an upower config, but did not provide a subpackage to actually install it on
device. Add the needed subpackage.
[ci:skip-build]: already built successfully in CI
(1) the deviceprofile differs from upstream 1.16.3 in the following respects:
(a) -export SXMO_NO_KEYBOARD=1 - allow use of the virtual keyboard
(b) +export SXMO_DMENU_LANDSCAPE_LINES="10"
+export SXMO_DMENU_PORTRAIT_LINES="6" - these two adjust the size of the
displayed dmenu menu.
* NB: All foregoing changes are already merged in sxmo-utils master.
(c) +export SXMO_TOUCHSCREEN_ID="TSC2005 touchscreen" - allows sxmo to
reliably toggle touch screen's enabled status
* The foregoing change is awaiting acceptance by upstream.
(2) The start hook differs from upstream 1.16.3 by the removal of the line that
starts conky. That program pegs N900 CPU usage at 100% all the time. This
change is not upstreamable, at least not for the time being
90b0205a ("postmarketos-ui-i3wm: configure wallpaper globally") directly copies
the default i3 config into the user's config directory. Change to using the
wizard instead
Reading the wl1251 data on each boot can be useful when using the same SD card
on different devices, allowing each to fetch its correct calibration data.
Additionally, this opens up the possibility to simplify the packaging (in
follow-up commit)
The handling for the lock key is currently unreliable (racy?). In many cases,
you have to toggle it twice to turn display off. Fix this by handling it via
acpid. Since the scripts currently depend on X11 tools, move them to the x11
subpackage. They can be moved back to the main device package in future when
Wayland support has been implemented.
Block i3 from handling the lock key to avoid additional races.
6c30cb42a4 ("linux-postmarketos-omap: enable new community kconfig options")
set CONFIG_LEDS_TRIGGER_DEFAULT_ON builtin. The consequence is that the debug
LEDs are now always turned on, which interferes with the keyboard backlight.
Since pmOS requires it to be builtin now, let us workaround the issue by not
loading leds_gpio at boot.
[ci:skip-build]: already built successfully in CI