Commit graph

133 commits

Author SHA1 Message Date
Johannes Marbach
5fa1755fba
main/postmarketos-mkinitfs: add modprobe subpkgs (MR 2693)
This adds two new subpackages postmarketos-mkinitfs-modprobe-lts and
postmarketos-mkinitfs-modprobe-edge that include /sbin/modprobe in the
initfs when one of the Alpine kernels (linux-lts or linux-edge) are also
installed.

Fixes: #1294

[ci:skip-build] already built successfully in CI
2021-11-22 09:48:39 -08:00
Nikita Travkin
316745a171
main/postmarketos-mkinitfs: Center splash images on the screen (MR 2662)
Alpine patches busybox to support image alignment in [1].
So far we don't need to align the spalshes in postmarketOS as those are
generated per device. However with generic images it becomes impossible
to support multiple resolutions with this approach.
Set the alignment to "Center" in fbsplash config so generic system
images can reuse the splash on multiple resolutions.

[1] - https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/busybox/0008-fbsplash-support-image-and-bar-alignment-and-positio.patch

[ci:skip-build] already built successfully in CI
2021-11-07 19:33:56 -08:00
DolphinChips
df9d656df5
main/postmarketos-mkinitfs: fix showing custom splash after running osk-sdl (MR 2647)
Support for custom "Loading..." splashes was added in MR 1776, but
`unlock_root_partition` function is still hardcoding default "Loading..."
splash. Fix this behaviour by replacing usage of `show_splash` function with
`show_splash_loading`, which accounts for presence of custom splash.

Closes #759
2021-11-01 15:34:39 +05:00
Clayton Craft
931a460c14
main/postmarketos-mkinitfs: upgrade to 1.1.2 (MR 2528) 2021-10-31 10:00:43 +01:00
Jami Kettunen
ea7d9007a4
main/postmarketos-mkinitfs: support more modular kernels (MR 2590)
* xts, libaes & aes are required for root partition FDE unlocking
* evdev is required by osk-sdl for input

[ci:skip-build] already built successfully in CI
2021-10-23 14:03:28 -07:00
Clayton Craft
45e07704df
main/postmarketos-mkinitfs: upgrade to 1.1.1 (MR 2540) 2021-09-21 10:40:54 +02:00
Clayton Craft
5963a970d5
main/postmarketos-mkinitfs: upgrade to 1.1 (MR 2516)
Changelog: https://gitlab.com/postmarketOS/postmarketos-mkinitfs/-/tags/1.1

Fixes #1234
2021-09-16 10:38:00 +02:00
Oliver Smith
e048839588
main/postmarketos-mkinitfs: don't rm vmlinuz-* (MR 2501)
Adjust post-upgrade script to not remove vmlinuz-*. This causes problems
with devices using kernels from Alpine, where the kernel is not
installed to /boot/vmlinuz, as it is now the case in postmarketOS, but
e.g. in /boot/vmlinuz-rpi. The intention was to clean up files when
migrating from the old postmarketos-mkinitfs to the new one (>= 1.0.0).
However, the /boot/vmlinuz* files are managed by apk, so they should
already get removed.

Add -v, so it prints a message when removing a file from /boot.
2021-09-08 23:40:13 +02:00
Clayton Craft
667f158e8d
postmarketos-mkinitfs: upgrade to 1.0.2 (MR 2489)
[ci:skip-build] already built successfully in CI
2021-09-05 15:29:59 -07:00
Clayton Craft
1bbb98347d
main/postmarketos-mkinitfs: use new mkinitfs (MR 2426)
This replaces the mkinitfs script with a re-write (in Go). The
re-written mkinitfs will atomically replace the initfs in /boot, check
for free space before doing so, and try to do whatever it can to not
leave the system in an unbootable state by botching the initfs
creation/installation.

pmb:cross-native with go cross compiling doesn't work exactly, it makes
the correct binary, but on Alpine go uses -buildmode=pie which creates a
dynamic thing, and the interpreter is wrong (e.g. it it set to use the
host arch's interpreter, like /lib/ld-musl-x86_64 even though
GOARCH=arm64)

The init.sh script is no longer a template, "initramfs-extra" is used.

Fixes https://gitlab.com/postmarketOS/pmaports/-/issues/1019
fixes https://gitlab.com/postmarketOS/pmaports/-/issues/660
2021-09-03 10:08:34 -07:00
Caleb Connolly
34623c4a0a
postmarketos-mkinitfs: fix charging-sdl for kmsdrm devices (MR 2098)
This fix was pending since before charging-sdl was deprecated and still
provides value should anyone wish to pickup and improve charging-sdl
again.

charging-sdl currently does not check for devices using mesa, even
though it supports it in the same way as osk-sdl. Check for msa support
and set SDL_VIDEODRIVER in that case.

Also fix the font path, as it was reading both keyboard-font and
keyboard-font-size from osk.conf.
2021-09-01 11:41:50 +03:00
Luca Weiss
58eaa90874
main/postmarketos-mkinitfs: change wait for subpartitions (MR 2432)
Previously it was assumed that with the counter and the sleep 0.1 the
process would take about 10 seconds to complete. On newer devices with
tens or even hundreds of partitions going through all partitions already
takes a significant amount of time, so change the logic to measure the
time elapsed instead.
2021-08-22 20:15:40 +02:00
Clayton Craft
2283190a93
main/postmarketos-mkinitfs: move dev node creation to initfs (MR 2407)
There should be no reason that this has to be done by mkinitfs, and
moving it to initfs simplifies mkinitfs (and the creation of a
replacement)
2021-08-16 19:04:38 +02:00
Caleb Connolly
3e86acc9d9
postmarketos-mkinitfs: flashing: fix wrong flavor (MR 2401)
The flavor string was naively parsed using sed by removing everything
before the first hyphen, this breaks for -rc kernels. Instead lets glob
/usr/share/kernel for the installed kernel flavor. This will also
prevent the kernel being flashed if the running kernel has a different
localversion than the updated one.

[ci:skip-build] already built successfully in CI
2021-08-10 00:09:34 -07:00
Oliver Smith
7139a82837
main/postmarketos-mkinitfs: support pmOS_i_boot (MR 2337)
Support the shorter label for the installer's boot partition, that works
with the 11 character limit of fat32 partitions.
2021-07-12 07:34:56 +02:00
Clayton Craft
0f1c765e10
postmarketos-mkinitfs: don't depend on osk-sdl, add to initfs conditionally (MR 2242)
This replaces the dependency on osk-sdl with a dependency on a
postmarketos-fde-unlocker virt. package

osk-sdl and its dependencies are also added contitionally to the initfs,
based on whether the osk-sdl exe is installed in the rootfs

Also see:
https://gitlab.com/postmarketOS/pmbootstrap/-/merge_requests/2066
2021-06-26 16:33:35 -07:00
Clayton Craft
c6a5e885c0
postmarketos-mkinitfs: disable correct shellcheck test (MR 2260)
Shellcheck 0.7.2 has a change that gives many error conditions their own
SC30** codes, instead of including them in SC2039. This updates the
scripts in this package that "disable SC2039" to disable the new code.

New codes added in shellcheck: cfd68ee0c2ebfd0ab08a1d4bf628162b454dc207
2021-06-17 18:09:44 -07:00
Caleb Connolly
70b0cf24e5
postmarketos-mkinitfs: flash new boot image (MR 2215)
On Android devices that support kernel updates (marked by the deviceinfo
variable "deviceinfo_flash_kernel_on_update") lets flash the kernel and
initramfs automatically!
2021-06-08 10:44:41 -07:00
Caleb Connolly
48e8b93ac6
postmarketos-mkinitfs: use variable for bootimg (MR 2215)
Use a variable for "bootimg" in create_bootimg rather than repeat the
same pattern replacement.
2021-06-08 10:44:41 -07:00
Clayton Craft
9088fbb6b9
postmarketos-mkinitfs: disable ps2mouse module when running directfb (MR 2201)
On my librem 5 when using directfb in initfs, touch input is really
inconsistent... the cursor seems to jump around and it's hard to enter
keys in osk-sdl. This is completely 'fixed' by disabling the ps2mouse
input module in dfb.

I guess this might cause mice to stop working (?), but I can't think of
any situation where someone would run osk-sdl in initfs on a device that
has a ps2 mouse but no keyboard (which would make more sense to use for
entry than the mouse..)
2021-05-27 22:28:57 +02:00
Martijn Braam
e0136b2abc
main/postmarketos-mkinitfs: allow osk-sdl user overrides (MR 2184) 2021-05-27 22:24:00 +02:00
Bart Ribbers
27b8ef368f
*/*: replace uboot-tools dependency for u-boot-tools (MR 2141)
uboot-tools is provided by u-boot-tools but sometimes apk still gets
confused. This change prevents errors such as

pine64-pinephone:~$ sudo apk upgrade --verbose
WARNING: Failed to perform initial self-upgrade, continuing with full upgrade.
ERROR: unable to select packages:
  uboot-tools (virtual):
	    provided by: u-boot-tools
			    required by: device-pine64-pinephone-0.25-r1[uboot-tools]
[ci:ignore-count]
[ci:skip-build]: already built in CI successfully
2021-04-27 22:01:06 +02:00
Luca Weiss
70173bde87
main/postmarketos-mkinitfs: disable charging-sdl (MR 2111)
See also #1064
2021-04-17 22:53:10 -07:00
Bobby The Builder
9ea2e7e828
main/postmarketos-mkinitfs: show resizefs splash (MR 1996)
[ci:ignore-count] [ci:skip-build]
2021-04-11 20:03:33 +02:00
Oliver Smith
a61cae84a5
main/postmarketos-mkinitfs: add sync before exit (MR 1850)
[ci:skip-vercheck]
2021-04-11 19:44:54 +02:00
Bobby The Builder
c4f050ffcd
main/postmarketos-mkinitfs: add f2fs (MR 1850) 2021-04-11 19:43:23 +02:00
Bobby The Builder
9eb97c73df
main/postmarketos-mkinitfs: avoid unneeded resizefs (MR 1850) 2021-04-11 19:43:23 +02:00
kekzoz
4e4230093c
main/postmarketos-mkinitfs: add postprocess scripts (MR 2056)
[ci:skip-build]: already built successfully in CI
2021-04-05 09:32:19 +02:00
Oliver Smith
31ed6f21ef
main/postmarketos-mkinitfs: fix space issues (MR 2051)
In order to have hardware acceleration in osk-sdl, we have included mesa
for some devices (like the PinePhone) in initfs-extra. Mesa drags in
libLLVM, which got a size increase of 27 MB in the last version. This
leads to running out of space on the boot partition:

  ==> initramfs: creating /boot/initramfs-postmarketos-allwinner-extra
  gzip: write error: No space left on device
  cpio: write error: Broken pipe

Improve the situation by not directly writing initfs-extra to /boot
(next to the old version), but to a temporary directory first. Replace
the old version with the new version afterwards (like before).

This is a rather minimal fix for this specific issue. The mkinitfs
script needs more fixing (it's one of the oldest pieces of code in
postmarketOS and could use a rewrite...), but that's out of scope for
this patch.
2021-03-21 17:22:44 +01:00
Clayton Craft
4243b95bd0
main/postmarketos-mkinitfs: refactor osk-sdl config/running (MR 1870)
- Simplified logic for setup/running osk-sdl in initfs
- include libGLESv2 when running osk-sdl w/ mesa
- depends on osk-sdl >=0.62
2021-02-22 15:40:44 +03:00
Oliver Smith
e8c76175f6
main/postmarketos-mkinitfs: add pmOS_inst_boot (MR 1820)
Find partitions with the label "pmOS_inst_boot" too, and prefer using
them as boot partition over ones with label "pmOS_boot". (I'd use
"pmOS_install_boot", but there is a character limit in the label.)

Without this, the initramfs may choose the wrong boot partition if
postmarketOS is available once as install OS (on device installer) on
the SD card and once on the eMMC (installed).

I just had this problem with QEMU when simulating the install from SD to
eMMC use case with pmbootstrap qemu --second-storage. The pmOS initramfs
scripts would detect the previously created eMMC boot partition as the
proper one and mount it. It would boot into the right root partition,
because that already has a different label (pmOS_install instead of
pmOS_root), but because the wrong boot partition is already mounted,
during the install it would not be possible to run mkfs on it.
2021-01-27 16:12:27 +01:00
Ion Agorria
4351a5bc1c
main/mkinitfs: Pass signing flag to blobpack (MR 1803)
This patch checks if deviceinfo_bootimg_blobpack is "sign"
in that case it passes signing flag for devices that require.

Devices (tf101) that don't use signing will continue working
when passing "true" as now.
2020-12-28 15:04:07 +01:00
El Koulali András
676f86fd43
main/postmarketos-mkinitfs: include support for pxa-mkbootimg (MR 1823)
[ci:skip-build]: already built successfully in CI
2020-12-27 21:39:43 -08:00
Oliver Smith
2f4a2ea087
main/postmarketos-mkinitfs: improve keyboard-font check (MR 1782)
Fix failure in the osk-sdl "keyboard-font" check when there is a second
key starting with "keyboard-font" (as in osk-sdl MR 105):

	==> initramfs: creating /boot/initramfs-postmarketos-allwinner-extra
	ERROR: Font specified in /etc/osk.conf does not exist!
	ERROR: postmarketos-mkinitfs-0.17-r0.trigger: script exited with error 1
2020-12-03 20:02:02 -08:00
Oliver Smith
c108a5a8d1
main/postmarketos-mkinitfs: allow splash override (MR 1776)
Make it possible to set a custom splash screen by placing a
splash.ppm.gz file on the boot partition.
2020-12-03 11:30:25 +03:00
Bart Ribbers
7573f5fce4
main/postmarketos-mkinitfs: workaround for not being able to find provider of kpartx (MR 1732)
Because of
https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10725,
cmd:kpartx can not be found. That bug obviously needs to be fixed, but
let's workaround it for now by just depending on the package that
provides it.
2020-11-17 21:08:03 +01:00
clayton craft
0e30c6f760
postmarketos-mkinitfs: fallback to directfb if osk-sdl fails w/ mesa (1625) (MR 1625) 2020-11-12 23:42:39 -08:00
clayton craft
13fbb3e501
main/postmarketos-mkinitfs: set no_supertile for osk with mesa (MR 1625)
This is needed by the librem 5, else the graphics are
distorted/unusable.
2020-11-12 23:41:29 -08:00
Luca Weiss
a6ec22b9a4
main/postmarketos-mkinitfs: use kmsdrm sdl backend for osk-sdl (MR 1625) 2020-11-12 23:41:28 -08:00
Luca Weiss
0fac39abe1
main/postmarketos-mkinitfs: fix incorrect cpio usage (MR 1619)
cpio expects a newline-separated list of files from stdin by default,
and you can change that to a NULL-terminated list of files by using the
'-0' switch.

Previously we were passing a NULL-terminated list ('-print0') and using
cpio with the default setting. For some reason busybox cpio works with
that but GNU cpio doesn't like that and generates an initramfs without
any files (as it only gets "a single file").

With this change the initramfs generation works fine with both busybox
cpio and gnu cpio.

Fixes #815
2020-10-06 18:52:09 +02:00
Bart Ribbers
01019884fb
main/postmarketos-mkinitfs: add new trigger for osk-sdl (MR 1563)
We now trigger on files in /usr/share/postmarketos-mkinitfs-triggers.
This can be used by other packages like osk-sdl for which an updated
version would otherwise never be used in the initramfs
2020-09-19 17:14:20 +03:00
Luca Weiss
37e43bcaac
main/postmarketos-mkinitfs: add mediatek header in mkinitfs (MR 1483)
Previously we added the header in the kernel packages but as we already
add the ramdisk header here and to simplify the process we also add the
addition of the kernel header into mkinitfs.
2020-08-22 10:38:53 +02:00
Martijn Braam
87a009a9b8
main/postmarketos-mkinitfs: fix error on missing dtb (MR 1491) 2020-08-11 10:52:14 +02:00
Oliver Smith
bfa705b745
main/postmarketos-mkinitfs: fix device sed regex (MR 1436)
The p? is not redundant. Without it, the p in mmcblk0p2 for example does
not get cut off, meaning the resulting device is not "mmcblk0" but
"mmcblk0p". My bad, sorry for the breakage.

Fixes: 9f6600ba ("main/postmarketos-mkinitfs: rm pmOS_deleteme")
Fixes: 9d86f6fe ("main/postmarketos-mkinitfs: resize: unallocated space check, even if forced")
2020-07-22 09:18:10 +02:00
Oliver Smith
9f6600ba18
main/postmarketos-mkinitfs: rm pmOS_deleteme (MR 1428)
Remove the "pmOS_deleteme" partition left behind by the on-device
installer, if it exists. Let the existing resize_root_partition() extend
the root partition over the newly gained space (and rest of the storage
device) right afterwards.
2020-07-21 22:53:03 +02:00
Oliver Smith
b55d95f3a9
main/postmarketos-mkinitfs: resize_root_partition: update comment (cosmetic) (MR 1428) 2020-07-21 22:53:02 +02:00
Oliver Smith
9d86f6fe92
main/postmarketos-mkinitfs: resize: unallocated space check, even if forced (MR 1428)
In resize_root_partition(), put the unallocated space check into an
extra function has_unallocated_space(). Run it even if
PMOS_FORCE_PARTITION_RESIZE is used, so we don't attempt to resize the
partition if there is no free space.

While at it, change "sed 's/p?2$//'" to "sed 's/2$//' in an already
modified line, because it means the same thing and is less confusing
(? in regex means: 0 or 1 time).
2020-07-21 22:53:02 +02:00
Martijn Braam
2fb6d11f91
main/postmarketos-mkinitfs: allow multiple dtbs (MR 1163)
Allow setting multiple dtb filenames in the deviceinfo seperated
by spaces
2020-07-16 23:14:54 +02:00
Oliver Smith
863ec713ba
main/postmarketos-mkinitfs: mount /sysroot/boot (MR 1398)
Mount the boot partition at /sysroot/boot and keep it mounted, when
running the switch_root command. This way, OpenRC doesn't need to mount
it and possibly use the wrong partition. The OpenRC service does not use
the same logic to find the boot partition, in particular it does not
support the pmos_boot kernel parameter.

While at it, print the mountpoint and read-only/read-write arguments in
the mounting log message for both root and boot.

Fixes: #664
2020-07-08 18:02:49 +02:00
Oliver Smith
9be8b59a00
main/postmarketos-mkinitfs: support pmOS_install (MR 1296)
Prefer booting from a pmOS_install partition if it exists, but do not
resize it.

Related: https://wiki.postmarketos.org/wiki/On-device_installer
2020-06-17 21:41:06 +02:00