Commit graph

112 commits

Author SHA1 Message Date
Pablo Correa Gómez
1229616e21
main/postmarketos-base: add service to mount /tmp as tmpfs (MR 4588)
And enable it by default, since it's a sensible thing to do.

This makes the bootmisc config file unnecessary, since it was only
used before to make sure that /tmp was wiped on every boot.

Mounting /tmp as a tmpfs will be skipped if:
* The user or maintainer configured deviceinfo_tmp_as_tmpfs_size=0
* If they didn't but the device has less than 2GB of RAM
* And in any case, if it is already mounted, to respect users that
  might have it in /etc/fstab

The options for mounting /tmp has been copied from my local debian
tmp.mount service. The only real difference is that we are mounting it
after /etc/fstab, and they do so before.

Fixes #2233
2023-12-21 17:38:45 +01:00
Caleb Connolly
7efcec020d
postmarketos-base: disable openrc syslog service (MR 4617)
Ensure that we don't have two logging daemons running!

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
2023-12-15 23:15:55 +00:00
Clayton Craft
7e55caa84c
main/postmarketos-base: change initcalls service to start before "wlan" (MR 4564) 2023-12-09 13:23:15 -08:00
Caleb Connolly
128f2b150b
main/postmarketos-base: enable logbookd on upgrade (MR 4549)
Logging is important, we want our users to have logging, so make sure we
enable the new logbookd service on existing installation.

We check that we're upgrading from a postmarketos-base version that
predates logbookd and only enable the service in this case. This way we
won't enable it again for folks who disabled it manually.

Signed-off-by: Caleb Connolly <caleb@connolly.tech>

[ci:skip-vercheck]
2023-12-09 01:05:54 -08:00
Martijn Braam
3460ae18d4
main/postmarketos-base: depend on logbookd (MR 4549)
Use logbookd to replace the busybox in-memory logger. The default
configuration of logbookd still logs in-memory but writes out the log on
shutdown or manual trigger.

The logread command is also replaced by a drop-in replacement for the
busybox tool.
2023-12-08 22:57:47 -08:00
Clayton Craft
dbd23fb13a
main/postmarketos-base: enable zram-init service on upgrade (MR 4598)
The post-upgrade script in pmos-base isn't symlinked to the post-install
script, so zram-init wasn't being enabled on systems that upgraded to
the pmos-base version that intro'd this feature. I think this should
have been enabled by default on upgraded systems. There's a deviceinfo
toggle for it, so users who won't want to use this can set that var to
disable it, in that case having the service enabled is basically a
no-op.

Update by Oliver: add a comment to mention the deviceinfo variable

[ci:skip-build]: already built successfully in CI
2023-12-07 20:37:56 +01:00
Clayton Craft
1c56a8a0d1
main/postmarketos-base: include os-release in the initramfs (MR 4470) 2023-11-02 08:44:31 +01:00
Pablo Correa Gómez
c5d147be99
main/postmarketos-base: adapt to new deviceinfo path (MR 4283)
This greatly simplifies the trigger, since now we can monitor a
directory.

In addition, depend on the latest devicepkg-utils
2023-09-25 09:20:32 +02:00
Pablo Correa Gómez
04abb5b1a7
main/postmarketos-base: migrate wrong timezone configurations (MR 4308)
So that old installations that run setup-timezone without "-i" do not
need to execute manual steps to get sensible timezone configurations.

See https://gitlab.com/postmarketOS/pmaports/-/issues/2168 for more context

Fixes #2168
[ci:skip-build]: already built successfully in CI
2023-08-07 09:41:53 +02:00
Newbyte
ea7522f44e
main/postmarketos-base: use source_deviceinfo (MR 4129) 2023-06-03 17:44:25 +02:00
Raymond Hackley
2baa079111
main/postmarketos-base: replace /etc/sudoers from sudo-ldap (MR 3972)
sudo-ldap is providing cmd:sudo/sudo-virt.
Replace files from sudo-ldap to solve conflict about /etc/sudoers

Fixes #2032
[ci:skip-build]: already built successfully in CI
2023-04-02 12:34:14 +02:00
Clayton Craft
eed476097e
postmarketos-base: depend on postmarketos-initramfs (MR 3895)
Changes the dependency from pmos-mkinitfs to pmos-initramfs, so now the
dependency chain for boot config packages is:

    base -> postmarketos-initramfs -> postmarketos-mkinitfs -> boot-deploy

Sorting dependencies this way makes sense because "base" just needs an
initramfs, it doesn't care about the implementation (that currently uses
"postmarketos-mkinitfs.")

[ci:ignore-count]
[ci:skip-build] already successfully built in CI
2023-03-09 17:42:36 +01:00
Caleb Connolly
702088baff main/postmarketos-base: use pbsplash (MR 2878) 2023-02-18 01:40:28 +00:00
Anton Bambura
99f1489c26
main/postmarketos-base: depend on postmarketos-mkinitfs>=1.5.1-r5 (MR 3854)
Related: discussion in MR 3791
[ci:skip-build]: already built successfully in CI
2023-02-08 08:54:56 +01:00
Clayton Craft
bca632d4f6
postmarketos-base: enable using zram swap by default (MR 3752)
This installs zram-init and sets it to start on boot for all
devices/UIs. The included conf.d/zram-init also allows diabling using
zram swap or overriding the size by using a deviceinfo var.

I did an analysis of the pmos base install size with the 'none' UI
selected, after depending on zram-init, and the following new package is
installed:
        zram-init-11.1-r1 installed size: 40 KiB

These packages are dependencies of zram-init, however they are already
installed in the base image (with 'none' UI) so they are not counted
above:
        util-linux-misc-2.38.1-r0 installed size: 6816 KiB
        e2fsprogs-extra-1.46.5-r4 installed size: 1324 KiB

So this seems like a very small price to pay for the benefit of not
making the logic/implementation more complicated than this.

     * Starting busybox syslog ... [ ok ]
    ssh-keygen: generating new host keys: RSA ECDSA ED25519
     * Starting sshd ... [ ok ]
    zram swap: activating with size: 243 MB
     * Loading zram module...
     [ ok ]
     * Swap->zram0
     [ ok ]
     * Starting local ... [ ok ]

This change introduces one new deviceinfo variable:
deviceinfo_zram_swap_pct: percentage of RAM to use for zram swap

Default percentages if the second var is unset are explained in the
zram-init file this commit adds. A value of 0 disables zram swap.

fixes #1133
2023-01-11 15:39:40 +01:00
Elagost
fd90572c61
postmarketos-base: replace sudo with cmd:sudo (MR 3721)
[ci:skip-build] already built successfully in CI
2022-12-18 13:23:33 -08:00
Raymond Hackley
d6cb995b99
main/postmarketos-base: add regulator-haptic udev rules (MR 3691)
Add rules for regulator-haptic, which is used on:
- samsung-e5/e7
- samsung-cprime/gprime
- samsung-j3/j5(x)

Note that regulator-haptic is not supported on some devices yet,
and samsung-e5 is not ported at the moment.

[ci:skip-build]: already built successfully in CI
2022-12-07 09:46:19 +01:00
Anjandev Momi
7270f472e3
treewide: fix tabs, final newline, trailing whitespace (MR 3530) 2022-10-16 16:27:22 +02:00
Minecrell
5f140538bf
main/postmarketos-base: install mesa-dri-gallium only if needed (MR 3478)
At the moment almost all device packages force installation of the Mesa
drivers, even when they are not used by any application (for example on
a minimal headless installation with "none" or "console" UI).
Omitting mesa-dri-gallium from such installations saves about ~150 MiB
of disk space (469 MiB -> 317 MiB rootfs for minimal installation on
arrow-db410c).

The "classic" drivers have been removed from Mesa so only one mesa-dri-
package exists now: mesa-dri-gallium contains all Mesa drivers,
llvmpipe, freedreno, lima, panfrost, Intel (iris/crocus), ...

This means we can easily create an install_if package in
postmarketos-base that installs that driver package only if needed
(= only if another package requires the "mesa" package).

Strictly speaking the install_if could be restricted further since
mesa-dri-gallium is only needed by "mesa-egl", "mesa-gbm" and "mesa-gl"
but not e.g. the Vulkan drivers. Having three postmarketos-base
subpackages (one install_if for each of them) seems a bit
overengineered, though. "mesa" is a common dependency of all three
of them, so using install_if="... mesa" should be good enough.
2022-10-11 11:19:30 +02:00
Newbyte
f2c7c48e2a
main/postmarketos-base: make apk interactive by default (MR 3444)
This would mitigate issues where apk unexpectedly replaces packages
somewhat as this way the user will be able to see precisely what changes
will happen to their system before they are committed. Furthermore, most
users are likely accustomed to package managers like apt, dnf, pacman,
among others that all are interactive by default and as such this would
provide a more familiar experience for them.

This will not affected pre-existing installs, and advanced users who
do not like this behaviour can restore the old one by deleting
/etc/apk/interactive.

[ci:skip-build]: already built successfully in CI
2022-09-28 09:18:55 +02:00
Dylan Van Assche
8c291862b6
main/postmarketos-base: add replace for busybox-openrc (MR 3400)
Alpine refactored the Busybox APKBUILD which resulted into a few
renamings like busybox-initscripts to busybox-openrc.

See 8b30ff10ab
2022-09-04 12:58:15 +02:00
David Wronek
2e11baa90d
main/postmarketos-base: Add alpine-release to replaces (MR 3372)
Upstream changed the alpine-base package. Conflicting files are now in
alpine-release instead of alpine-base.
2022-08-20 21:47:39 +02:00
Dylan Van Assche
a3f7bf3e1a
main/postmarketos-base: use setup-devd (MR 3302)
Alpine does not use setup-udev anymore and provides the same
functionality through setup-devd. The setup-udev script was deleted [1]
but postmarketos-base still used it and caused pmbootstrap to fail when
building a device image. Use the rc-service setup directly from
setup-devd.

[1] b56c4c2b9d
2022-07-20 10:05:27 -04:00
Jakob Hauser
b6f19a2ed7
main/postmarketos-base: remove udev rule for rt5033 battery refresh (MR 3223)
The refresh method was removed in UPower version 0.99.18 for regular
usage (available in debug mode only).
2022-06-12 15:44:47 +02:00
Jack Knightly
4912e44aa3
main/postmarketos-base: modify tm2-touchkey udev rule for midas (MR 3192) 2022-06-09 08:08:41 +02:00
Raymond Hackley
ab83b8cbeb
main/postmarketos-base: udev rule for zinitix touchkey (MR 3015)
The udev file "20-zinitix-input.rules" maps the touchkey on Zinitix-TS to
KEY_MENU and KEY_BACK.
2022-03-21 22:25:54 +09:00
Raymond Hackley
9833cc8a64
samsung-{a3,a5,a7,klte,serranove}: move tm2-touchkey rules to pmos-base (MR 2926)
Fixes: #1422
2022-03-03 19:21:20 +03:00
Alexey Min
432627c921
main/postmarketos-base: fix error after upstream changes (MR 2970)
Fixes error: postmarketos-base-18-r0: trying to overwrite etc/fstab owned by alpine-baselayout-data-3.2.0-r20.

caused by 9ecba8a514

[ci:skip-build] already built successfully in CI
2022-03-02 16:12:10 -08:00
Clayton Craft
caec14561d
postmarketos-base: add sysctl config to disable rp_filter on ipv4 (MR 2943)
MMS support (via mmsd-tng) involves sending/receiving network
requests/responses over the wwan interface. If it's ipv4-only and the
device is connected to some other ipv4 network on another iface (like
wifi), this can cause the rp_filter to reject responses on wwan iface
because it incorrectly thinks they are martian packets.

This does theoretically disable some "security" feature in the kernel,
but it's worth noting that:

1) rp_filter isn't implemented at all in the kernel for ipv6

2) other distros (mobian, pureos at least) are also disabling rp_filter

3) this seems to be a relatively common problem with folks using mms on
   pmOS, since many carriers' data networks are ipv4-only

also see:
https://gitlab.com/kop316/mmsd/-/merge_requests/55/diffs?commit_id=b22c253fb939ff1eb949ea4e628706e6a28c851a

[ci:skip-build] already built successfully in CI
2022-02-16 12:08:24 -08:00
Luca Weiss
8aa04780b2
main/postmarketos-base: set distro logo in /etc/os-release (MR 2867)
With this apps like gnome-control-center will display the postmarketOS
logo instead of the default GNOME logo.
2022-01-21 01:09:59 +00:00
Clayton Craft
84b6b9a956
main/postmarketos-base: clear /tmp on boot (MR 2744)
This configures bootmisc to clear /tmp on bootup. I think most folks
expect distros to do this, many even mount /tmp as tmpfs. I don't think
that's a great idea in pmOS since RAM is usually limited on many
devices. So this, clearing it on boot, seems like a reasonable compromise.

Fixes #1342
2021-12-19 20:32:43 +03:00
Minecrell
74e8166c7d
main/postmarketos-base: fix file permissions of /etc/sudoers (MR 2610)
Installing postmarketos-base currently changes the file permissions
of /etc/sudoers:

  # apk add sudo
  # stat /etc/sudoers
  Access: (0440/-r--r-----)  Uid: (    0/    root)   Gid: (    0/    root)

  # apk add postmarketos-base
  # stat /etc/sudoers
  Access: (0044/----r--r--)  Uid: (    0/    root)   Gid: (    0/    root)

The file mode 0044 decodes to:
  - User *cannot* read
  - Group can read
  - Other can read

which does not make any sense. The "sudoers" man page makes it very
clear that this file should have a file mode of 0440 [1]
("readable by owner and group, writable by none").

This looks like a bad typo. However, given that only read permissions
were given out this shouldn't have major security implications
(except allowing all users to see who can use sudo).
Install the file with 0440 instead of 0044 to fix this:

  # apk add postmarketos-base
  # stat /etc/sudoers
  Access: (0440/-r--r-----)  Uid: (    0/    root)   Gid: (    0/    root)

[1]: https://www.sudo.ws/man/1.9.8/sudoers.man.html#Error_log_entries
2021-10-17 11:30:07 +02:00
Martijn Braam
0a4645eaec
main/postmarketos-base: depend on the keys package (MR 2477)
Have the keys be packagemanaged by default instead of preloading it
once with pmbootstrap
2021-09-01 11:37:15 +03:00
Jakob Hauser
4baa805b41
main/postmarketos-base: change permission on tm2-touchkey leds (MR 2380)
Allow users in group "input" to control the tm2-touchkey leds.

Additionally correcting the udev rule for disabling the tm2-touchkey leds by default.

[ci:skip-build] already built successfully in CI
2021-08-10 00:03:50 -07:00
Jakob Hauser
bd85700dea
main/postmarketos-base: udev tm2-touchkey and rt5033-battery (MR 2330)
The udev file "20-tm2-touchkey-leds.rules" disables the leds of
tm2-touchkey by default because they are in an unconfigured state.

The udev file "95-rt5033-battery-refresh.rules" triggers a refresh
of the rt5033-battery information within UPower 5 secs after
initialization. This avoids a wrong battery icon after boot.

The udev file "50-firmware.rules" was moved from /etc/udev/rules.d
to /lib/udev/rules.d.

Related: https://wiki.postmarketos.org/wiki/Packaging#Device_specific_quirks
2021-07-11 14:10:03 +02:00
Clayton Craft
4136eeae5a
postmarketos-base: add nofde subpackage (MR 2278) 2021-06-26 16:28:08 -07:00
Clayton Craft
92e43e8324
postmarketos-base: remove UI-specific config/dependencies (MR 2243)
These will be included in a new postmarketos-base-ui package
2021-06-23 13:00:00 +02:00
Clayton Craft
a83a0a0726
postmarketos-base: add nftables as dependency (MR 2060)
This enables the firewall by default, and could be split off into a
future ui-base package so that the firewall (among other things) are
enabled only when UIs are installed.
2021-06-14 14:30:50 -07:00
Ignacy Kuchciński
7fb10635e0
main/*: fix outdated url variables (MR 2226)
[ci:skip-vercheck]
2021-06-06 19:02:54 +02:00
Dylan Van Assche
5e562fdbc6
main/postmarketos-base: add pulseaudio config
Automatically switch to a connected USB or
Bluetooth audio device and duck the main volume
when a notification is received.
2021-06-02 18:58:04 +02:00
Oliver Smith
f3b949296d
main/postmarketos-base: alsa playing -> no inhibit (MR 2216)
Don't suspend the device while alsa is playing. I ran this for two days
in combination with suspend time set to 1 min on the pinephone and it
works great. Finally no suspend while VLC is playing podcasts.
2021-06-02 01:26:47 +02:00
Bart Ribbers
9387842aec
main/postmarketos-base: remove networkmanager from depends (MR 2174) 2021-05-24 11:39:07 +02:00
Dylan Van Assche
8330d2a552
main/postmarketos-base: add dependency on wireless-regdb (MR 1974)
CRDA in the kernel requires a regulatory database to be available
to configure the WiFi card correctly following the regulations in
each possible environment.
2021-02-23 14:54:49 +01:00
Martijn Braam
f099d73fc8
main/postmarketos-base: update motd for the cheatsheet (MR 1961) 2021-02-21 11:47:07 +01:00
Oliver Smith
6e7b75abb5
main/postmarketos-base: add dummy post-upgrade (MR 1964)
Add post-upgrade file with a warning, so we don't symlink it to the
post-install script.
[ci:skip-vercheck]: no need to rebuild the package

Related: build.postmarketos.org#85
2021-02-17 17:49:58 -08:00
Oliver Smith
e4ef9fba72
main/postmarketos-base: retire devmappings service (MR 1820)
Remove devmappings service. The original purpose of this service was to
ensure that /boot is mounted properly after the initramfs passed control
to OpenRC, because the initramfs used to umount /boot before that. With
/etc/fstab alone, /boot get not get mounted with subpartitions (which we
use on Android devices), if util-linux >= 2.33 was installed (MR 115).

Nowadays, we don't umount /boot in the initramfs before passing control
to OpenRC anymore (MR 1398). So this service isn't needed anymore, and
prevented the previous pmOS_inst_boot <> pmOS_boot patch from working
correctly.
2021-01-27 16:12:27 +01:00
Martijn Braam
3ac6f21c6c
main/postmarketos-base: ship os-release (MR 1522)
Ship the /etc/os-release file from the postmarketos-base package instead
of having it generated by pmbootstrap.
2021-01-07 23:42:49 +01:00
clayton craft
5a06a6bb06
postmarketos-base: replace elogind suspend hook with sleep-inhibitor (MR 1825)
This adds sleep-inhibitor as a dependency when elogind is present, and
installs a conf for it with some plugins enabled that are beneficial to
devices running pmOS. The elogind suspend hook is dropped.

This resolves issues where suspend is aborted in the hook *after*
PrepareForSleep is sent over dbus (which might cause some things to
disable radios/modems, etc for suspend).

The 'period' in the conf is in minutes, a value of 0.1 is 6 seconds,
which seems reasonable for releasing the lock when conditions for
inhibiting no longer apply, without spinning the CPU too frequently.
2020-12-28 00:36:35 +01:00
Oliver Smith
f430dae13b
main/postmarketos-base: add tinydm config (MR 1795)
Set postmarketOS default UID in tinydm config, so tinydm can be
upstreamed to Alpine without hardcoding the pmOS default UID in the
tinydm packaging.
2020-12-07 18:21:28 -08:00
Oliver Smith
8b7adeddf3
main/postmarketos-base: remove post-install config overrides (MR 1713)
Do not change config files in post-install scripts anymore (with sed
commands or by other means). Instead, ship the files inside the packages
and use "replaces", so apk allows the package to overwrite files from
other packages:
https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#replaces

Notes on specific files:
* /etc/elogind/logind.conf: original file only consists of commented out
  compile defaults. Copy them over for now. In the future we should be
  able to install our own config into a .d directory, without all the
  comments: 8358fc5950
* /etc/fstab: original file only has /dev/cdrom and /dev/usbdisk
  entries, which are not useful for postmarketOS:
  https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/alpine-baselayout/APKBUILD
* /etc/motd: reformat the text, add link to the chat
* /etc/conf.d/syslog: original file only contained 'SYSLOGD_OPTS="-t"',
  make the override file as if the sed statement from post-install was
  executed
* /etc/wpa_supplicant/wpa_supplicant.conf: post-install script touches
  this file. We probably added it back in 2017 in relation to enabling
  D-Bus (though the PR does not mention it explicity), but at least with
  the current init.d script of NetworkManager, we can simply have '-u' in
  wpa_supplicant_args:
  https://github.com/postmarketOS/pmbootstrap/pull/578
  https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/wpa_supplicant/wpa_supplicant.initd
* /etc/sudoers: base on original /etc/sudoers, but remove all the
  commented out stuff except for the visudo note at the top. We could
  also put a file in /etc/sudoers.d, but since the wheel line is present
  in the original /etc/sudoers and only commented out, it would be kind
  of unexpected to enable it in a file in /etc/sudoers.d. I prefer this
  stripped down version of the file, that is easy to read.
2020-12-03 13:11:03 +01:00