Commit graph

162 commits

Author SHA1 Message Date
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
Antoine Fontaine
41c2e1a307
main/postmarketos-mkinitfs: add mkinitfs to replaces (MR 1300)
fixes pmbootstrap#1851.
2020-06-15 02:32:25 +03:00
Niklas Cathor
6e75bf0e40
main/postmarketos-mkinitfs: fix mkbootimg call for devices w/o dtb (MR 1148)
Don't pass empty arguments to mkbootimg, when _second or _dt are not set.
2020-04-12 19:51:22 +02:00
Oliver Smith
23c58a681f
main/postmarketos-mkinitfs: modules from files (!1123)
Read kernel module names from files in
/etc/postmarketos-mkinitfs/modules and print out which modules are
required by which of these files as the initramfs gets generated. Put
the default modules into a new 00-default.modules. This allows mkinitfs
hooks to add modules to the initramfs.

Parse the modules from a file similar to modules-load.d, with commented
lines and empty lines ignored. Add a simple test script for that and run
it in check().
2020-04-12 00:56:22 +02:00
Oliver Smith
3e7604601a
main/postmarketos-mkinitfs: split mkinitfs funcs (!1123)
Split mkinitfs.sh into two files, so the functions (now in
mkinitfs_functions.sh) can be sourced in a test. Such a test will be
added in the next commit.

Move $BINARIES_EXTRA into the get_binaries_extra() function, so its
$(find...) does not get executed when sourcing the functions file. Move
$BINARIES into get_binaries() too for consistency.
2020-04-12 00:56:22 +02:00
Oliver Smith
74f42ebeb0
main/postmarketos-mkinitfs: pass shellcheck (!1123)
Make it pass shellcheck by fixing obvious mistakes like '==' instead of
'='. Add "shellcheck disable" lines for things that are intentionally done
or would be a bit more complicated to rewrite. It would be nice to
refactor some things like '${outfile/initramfs-/uImage-}', but this should
be done in a separate change (patches welcome).

Remove unused variable "modules_path". While at it, add two new fatal
error messages instead of just "exit 1" without any comment and remove
redundant mkdir in APKBUILD.
2020-04-12 00:56:17 +02:00
Daniele Debernardi
bd15afc217
main/postmarketos-mkinitfs: execute lddtree without privileges (!1133)
The lddtree script uses the scanelf utility which has some security check that causes a slowdown of the operation, executing it without privileges it's really faster.
2020-04-09 10:35:06 +02:00
Daniele Debernardi
36f15b58f6
main/postmarketos-mkinitfs: remove initramfs-extra cache (!1133) 2020-04-09 10:35:03 +02:00
Daniele Debernardi
de6deb8201
main/postmarketos-mkinitfs: check if initramfs-extra is missing (!1046) 2020-03-10 01:23:14 +01:00
Martijn Braam
ec83ab9a06
postmarketos-mkinitfs: fix unlocking with pmos_root (!943)
Fix --fde on the PinePhone (actually it fixes it for devices that
uses the pmos_root cmdline).
2020-03-01 00:43:08 +01:00
Minecrell
ed3eeeeebb
main/postmarketos-mkinitfs: append extra initfs hash to file contents (!983)
Partial revert of 24fa68c9 ("avoid storing initramfs-extra twice").

Some people have (rightfully) complained that including the hash
in the filename of the initramfs-extra prevents the device from booting
whenever the boot partition gets out of sync with the boot image.

In general we should assume that those two are in sync, but there is
no need to unnecessarily break this if previously booting the outdated
extra initramfs worked just fine.

At the end, the hash is just an implementation detail for the caching
mechanism - we need it when (re-)generating the initramfs, but it does
not have to be within the filename. Instead, we can simply append the
hash to the file contents. GZIP will simply ignore the trailing garbage.

The boot partition will then look like:
    $ cat /boot/initramfs-<flavor>-extra
    <GZIP data>d3c7b449c6fc811d97351bbc46852b66 (the hash)

This makes the filename of initramfs-extra nice and stable again.
It also fixes a regression where the initramfs-extra would no longer
get symlinked by "pmbootstrap export" (I was going to fix that in
pmbootstrap but now this solution is more appealing...)

While we're at it: Make the script more resilient again by writing
to a temporary file first, then move it (atomically) to the real path.
2020-03-01 00:31:27 +01:00
Dolphin von Chips
2bb9599dce
main/postmarketos-mkinitfs: add option to append SEANDROIDENFORCE to boot.img (!1000) 2020-02-27 20:19:21 +03:00
Minecrell
24fa68c9b6
main/postmarketos-mkinitfs: avoid storing initramfs-extra twice (!932)
At the moment we store the same initramfs-extra twice on the file system:
  - /boot/initramfs-<flavor>-extra
  - /var/cache/postmarketos-mkinitfs/initramfs-<flavor>-extra_<hash>

The second copy is exactly the same file, just with the <hash> (for caching)
appended to the filename.

We can avoid this by appending the hash directly to the filename
on the boot partition, i.e.
  - /boot/initramfs-<flavor>-extra_<hash>

This is possible because we only reference initramfs-extra from the main
initramfs, and we already replace the path in it dynamically.
It will just let the main initramfs load -extra_<hash> instead of just -extra.

This saves a few megabytes of disk space on the rootfs.
2020-02-10 01:38:18 +03:00
Minecrell
e3d07c832c
main/{devicepkg-dev,postmarketos-mkinitfs}: statically generate splash screens (!899)
We need to generate the splash screens separately for each device,
because they are specific to the device's display resolution.

At the moment we do this dynamically during the installation process.
This has the advantage that there is no need to re-build all device
packages when one of the splash screen is changed (or a new one is added).

In reality, however, the splash screens do not change very frequently.
On the other hand, generating the splash screens dynamically has signficant
disk usage overhead for a minimal ("none" UI) rootfs:

The Python interpreter together with the necessary libraries requires
about ~60 MB of disk space on aarch64.
The splash screens itself require about ~100 KB for 720x1280.

This is not necessary if we move the splash screen generation into
devicepkg-dev, which is used to build the device package for all devices.
Another advantage is that we no longer need the (rather complicated)
caching mechanism for splash screens - so we actually end up with less
lines than before.

rootfs size for samsung-a5ulte ("none" UI):
  Before: 450M
  After:  388M (-62M)

After this change, every(!) device package needs to be rebuilt once.
No changes are necessary in device packages.
2020-01-28 15:33:40 +01:00
Pops Dylan
8760409717
main/postmarketos-mkinitfs: enable profiling with bootchart (!852)
If (a) the kernel command line parameters include PMOS_BOOTCHART2 and
(b) /sbin/bootchartd exists (i.e., the bootchart2 package has been
installed), run /sbin/bootchartd instead of /sbin/init.
2020-01-13 15:44:51 +03:00
Martijn Braam
cfcf1e6d7d
main/postmarketos-mkinitfs: added pmos_boot and pmos_root (!756) 2019-11-24 20:16:41 +01:00
Danct12
dd028490c4
main/postmarketos-mkinitfs: make android_usb attrs customizable (!734)
ConfigFS USB attrs are customizable based on the `deviceinfo_usb_*` variables,
however some downstream kernels (e.g: msm-3.18) doesn't use configfs, instead
uses the traditional Android USB Gadget.

Based on `deviceinfo_usb_{idVendor/idProduct}` variables, we can change the USB
vendor and product.

So that on these devices, we can make it appear on USB bus as the correct USB
vendor/product ID, not "Google Inc. Nexus 4 (fastboot)"

Signed-off-by: Danct12 <danct12@disroot.org>
2019-11-11 13:56:47 +07:00
lambdadroid
803b8dcec9
main/postmarketos-mkinitfs: stop forcing full fsck on every boot (!723)
At the moment, a full file system check is forced even if the
file system is marked clean (i.e. it was properly unmounted the
last time it was used). On large file systems with slow I/O
(e.g. SD cards), this can take a significant amount of time.

Removing the -f option of e2fsck allows skipping the full
file system check if it is marked clean, speeding up the boot time.
2019-11-06 00:08:50 +01:00
Alexey Min
68821d2cb2
main/postmarketos-mkinitfs: make USB configfs attrs customizable (!706)
Some devices' downstream kernels may have different RNDIS/functionfs
drivers (ex. QCRNDIS) that require different values for some
configfs gadget attributes. Make it possible to customize with
deviceinfo file from device- package.

The idea is that each device- package can optionally specify a
bunch of `deviceinfo_usb_*` variables to customize the way it is
visible on USB bus. The ability to override
`deviceinfo_usb_rndis_function` is essential to make downstream
sdm660 based device to appear on USB bus.

While at it, make `idVendor`, `idProduct` and `serialnumber` also
customizable. So that we can make, for example, PineTab appear on
USB bus as PineTab, not as "Google Inc. Nexus 4 (fastboot)".
2019-11-05 23:33:22 +01:00
lambdadroid
74815e3312
main/postmarketos-mkinitfs: add option to place DTB in Android boot image second area (!700)
Mainline U-Boot looks for the device tree blob in the "second" area
of the Android boot image (see https://patchwork.ozlabs.org/patch/1025211/).

Add an option "deviceinfo_bootimg_dtb_second" to place the device DTB there.
2019-10-30 19:15:00 +01:00
lambdadroid
0c76dd4ce3
main/postmarketos-mkinitfs: configure USB gadget serialnumber (!684)
Currently, the USB networking setup using configfs does not configure
a "serialnumber" for the USB gadget. This means that an empty
serial number will be sent during USB enumeration.

This is usually not a problem, but it seems to cause issues under
special circumstances (on asus-me176c on one of my PCs).

The USB Gadget configfs documentation also suggests setting
the "serialnumber":
  https://www.kernel.org/doc/Documentation/usb/gadget_configfs.txt
It can be any string, so we can just set it as "postmarketOS" like
the manufacturer.
2019-10-23 23:27:16 +02:00
lambdadroid
2c57359b8a
main/postmarketos-mkinitfs: include ext4 and usb_f_rndis in initramfs (!673)
The initramfs needs ext4 (to mount the rootfs) and usb_f_rndis
(to enable USB networking on devices that use USB configfs).
If these are built as modules, they need to be included in initramfs.

[ci:skip-build]: already built successfully in CI
2019-10-13 21:22:42 +02:00
Oliver Smith
8c34ea6f81
main/postmarketos-mkinitfs: make shellcheck happy (!636)
We'll switch from whatever version of shellcheck is packaged in Debian
stretch to the newer version in Alpine edge in the next commit. Adjust
postmarketos-mkinitfs first, so it doesn't report any errors.
2019-09-26 21:27:58 +02:00
mgulin
9e37742928
main/postmarketos-mkinitfs: custom legacy uboot initfs addr (!578)
Seems like VIA/Wondermedia 8850 devices do not boot with the default
address. Add new deviceinfo_legacy_uboot_load_address variable to
allow setting a custom one.
2019-08-31 20:21:11 +02:00
lambdadroid
68be470893
main/postmarketos-mkinitfs: Do not forcefully include DRM in initfs (!548)
The DRM module itself can not do anything without a DRM driver.
It just takes up precious space (about ~5 MB for aarch64)
on the boot partition.

Devices that do include the appropriate DRM driver via
deviceinfo_modules_initfs will automatically pull in
"drm" and "drm_kms_helper" as dependencies, if needed.
So there is no need to depend on it explicitly.
2019-08-06 12:51:38 +02:00
Luca Weiss
c2444a0870
main/postmarketos-mkinitfs: Fix spaces->tabs (!536)
[ci:skip-vercheck]
2019-08-06 12:37:12 +02:00
Luca Weiss
ed182b60ff
main/postmarketos-mkinitfs: Use the original filename for the dtb (!536) 2019-08-06 12:37:12 +02:00
Daniele Debernardi
e4e38c2001
main/postmarketos-mkinitfs: add deviceinfo_framebuffer_landscape (!546)
Use deviceinfo_framebuffer_landscape during splash screen generation.
Also add the postmarketos-splash arguments variable to the computation
of the hash for the cache.

Adjust device-pine-pinetab to use the new variable, and therefore rotate
its splash screen.

[ci:skip-build]: already built successfully in CI
2019-08-06 12:00:31 +02:00
Luca Weiss
7699f8d537
main/postmarketos-mkinitfs: set pmOS-specific firmware path (!515)
Currently we rely on the fact, that the kernel asks user space to load
the firmware for it, so we can use the /lib/firmware/postmarketos
directory for firmware.

As the kernel has support for loading the firmware itself since
v3.7, and the parameter for adding an additional path to the search
paths was added with v3.10, we can use that to not rely on
CONFIG_FW_LOADER_USER_HELPER being set.
2019-07-25 20:30:04 +02:00
Martijn Braam
74ac6819c9
main/postmarketos-mkinitfs: verbose network log (!468)
Make the initfs show better errors in the network setup part.
2019-06-30 11:49:03 +02:00
Luca Weiss
693079abb5
mkinitfs: Introduce deviceinfo_append_dtb variable (!387)
We don't need to append the dtb to the kernel image in all cases, with
e.g. the u-boot bootloader we can load the dtb seperately from the
kernel image. Introduce a new variable deviceinfo_append_dtb, if set to
"true", append the dtb, otherwise just copy the dtb file to the boot
partition.

Fixes #260

[ci:ignore-count]
2019-06-02 03:13:43 +02:00
Martijn Braam
d72923dcd5
main: linux-postmarketos-allwinner: PinePhone updates
- main: postmarketos-mkinitfs: Add /run
  Create the /run directory in the initramfs so that cryptsetup doesn't
  crash on not being able to create /run/cryptsetup for lockfiles

- device: pine-dontbeevil: Remove workaround for touchscreen

- main: linux-postmarketos-allwinner: Implemented supplies for touchscreen
  This uses a slightly newer commit from the kernel repo that implements
  requesting a regulator in the touchscreen driver

- device: pine-dontbeevil: Remove ethernet from initramfs
  This actually makes debugging more complicated since networkmanager wont
  touch the ethernet adapter afterwards and the initramfs can be debugged
  over uart

- temp/u-boot: sync APKBUILD with upstream and update to 2019.04

- main: linux-postmarketos-allwinner: Use 20190521 git version
2019-05-23 14:39:21 +02:00
Martin Piatka
8caa370611 postmarketos-mkinitfs: Support initramfs compressions other than gzip (!334)
The postmarketos initramfs is larger than android initramfs. This causes
problems on some devices like htc-ace that have a very small boot
partition (4MB in htc-ace). I've been able to make the boot image small
enough to fit by compressing initramfs using lzma.
With this change it should be possible to change the compression in
deviceinfo like this: deviceinfo_initfs_compression='lzma'
or even deviceinfo_initfs_compression='lzma -9'. When no option is
specified it defaults to 'gzip -1'.

I've also added dependencies to compression utilities for all possible
initramfs compression algorithms.
2019-04-30 17:12:33 +00:00
Zhuowei Zhang
7df2c93459
main/postmarketos-mkinitfs: support verbose boot (!234)
Adds a new initfs hook, verbose-initfs, which doesn't do anything on its
own. Modify postmarketos-mkinitfs to check if this hook is installed and
if so run `set -x`.

It's done this way so verbose boot is enabled as early as possible,
before hooks are loaded.

Tested on the qemu-aarch64 device.

- pmboostrap initfs hook_add verbose-initfs
- pmbootstrap qemu --arch aarch64
- confirmed that commands are echoed to the console
2019-02-27 21:02:02 +01:00
Zhuowei Zhang
2a4d30e52a
main/postmarketos-mkinitfs: fix USB idVendor/idProduct values for ConfigFS (!190)
ConfigFS expects idVendor and idProduct values to be prefixed with 0x.

Without this change, google-crosshatch shows as a device with 0:0 as the
idVendor/idProduct in lsusb:

Bus 001 Device 004: ID 0000:0000

This confuses VirtualBox: it has trouble detaching this device from
a virtual machine, so one must manually use ifconfig to bring down the
old USB network connection before reattaching.

With this change, the idVendor/idProduct is correct:

Bus 001 Device 004: ID 18d1:d001 Google Inc.

This issue also seems to affect other devices with ConfigFS, such as the
Nexus 5:

https://matrix.to/#/!clcCCNrLZYwdfNqkkR:disroot.org/$15487159511194991apGpy:matrix.org
2019-02-05 10:07:21 +01:00
Clayton Craft
018e28cc66
main/postmarketos-mkinitfs: aarch64 uboot initrd (!141)
Support generating the aarch64 legacy uboot initrd files, not only the
armhf version. Use deviceinfo_arch to choose the right arch.
2019-01-28 20:45:18 +01:00
Daniele Debernardi
a98b900b65
postmarketos-mkinitfs: skip fbsplash for deviceinfo_no_framebuffer (!108)
Also noticed that the debug-shell hook wasn't sourcing the deviceinfo
and still showing the splashscreen even with
deviceinfo_no_framebuffer="true", now is fixed and tested.

Additionally, fix a typo in the existing
"NOTE: Skipping framebuffer setup..." message.
2018-12-26 20:21:55 +01:00
pinoaffe
0188930f21
main/postmarketos-mkinitfs: iterate over all block devices and partitions in init_functions.sh:mount_subpartitions() 2018-11-27 07:47:11 +01:00
Pierre Parent
5db8fd724c
main/pmos-mkinitfs: wait for rootfs, framebuffer
Fix Nexus 5 (hammerhead) boot and framebuffer issues at startup by
waiting up to 10 seconds until the rootfs and /dev/fb0 have been
found. Waiting for the framebuffer device can be disabled by setting
deviceinfo_no_framebuffer=true in the deviceinfo.
2018-11-27 07:47:11 +01:00
Luca Weiss
98c88bd9f6
Fairphone 1 support 2018-11-27 07:47:11 +01:00
Martijn Braam
fb23669e29 * Added device package for the pine-a64lts
* Added linux-postmarketos-allwinner kernel
* Added copy of alpines u-boot package with pine-a64lts support
* Changed postmarketos-mkinitfs to add the plain .dtb file to the boot partition
2018-09-16 18:02:06 +02:00
Marti Raudsepp
ce5a83b978 Add initramfs error message when charging-sdl fails to run
There are devices where charging-sdl/directfb fails (osk-sdl#77).

It's nicer to give an error message than display "Loading..." forever.
2018-08-14 02:02:13 +00:00
Grant Miller
b74bf01597 Detect androidboot.bootchg=true
Observed on Samsung Galaxy S4
2018-07-29 17:54:16 -05:00
joshas
1e498ea62a Copy directfbrc config to initfs-extra image 2018-07-28 15:25:47 +03:00
Oliver Smith
3d6da2e4da s/system partition/rootfs: fix remaining mentions
Follow-up to !1373, where `pmbootstrap flasher flash_system` was
replaced with `pmbootstrap flasher flash_rootfs`. We still had used
terms like "system partition" in a lot of places.

This commit replaces it everywhere, so it's clear that we're talking
about the pmOS rootfs (which may or may not be installed to Android's
system partition).
2018-07-15 23:41:31 +02:00
Oliver Smith
a31244d28a Remove github.com references
* Travis and Coveralls badges
* aports: instead of <https://github.com/postmarketOS>, use
  <https://postmarketos.org>
* References to full URLs to issues and pull requests replaced with
  a hash and the number
* grsec check: simplify error message, remove link to github issue
  (nobody is using that anymore anyway)
2018-06-30 09:00:48 +02:00
Oliver Smith
e91d2f7ba3 Don't run dhcpcd on the raspberry pi (#1580)
Adds deviceinfo_disable_dhcpcd and sets it to true for the pi.

Related: #1547.
2018-06-21 21:10:12 +00:00
Oliver Smith
0921c2eaf1 Fix conflict with mkbootimg and android-tools (#1557)
Alpine ships `mkbootimg` with the `android-tools` package now. This
conflicts with the `mkbootimg` fork from osm0sis (see #441).

Changes:
* Rename `mkbootimg` to `mkbootimg-osm0sis` (aport and binary name)
* `mkbootimg-osm0sis`: provides `mkbootimg` now (so we don't need to
  change all the device aports), update version to 2018.05.10
* Adjust our `mkinitfs` script to call `mkbootimg-osm0sis`
* Better aport description
* pkgrel_bump testcase: don't fail on deleted aport
2018-06-17 21:26:34 +00:00
Mayeul Cantan
71010f6d73 Add charging mode detection for kylevess (#1526)
As documented here:
https://wiki.postmarketos.org/wiki/Samsung_Galaxy_Trend_lite_(s7390g)

This might be set on other devices as well. This patch also bumps
postmarketos-mkinitfs one minor version.
2018-06-01 12:36:05 +02:00
Oliver Smith
f5d5a9be19 msm-fb-refresher: use initfs hook (#1438)
The `msm-fb-refresher` updates the screen for msm based devices. It is
not needed for all devices, so we had some extra code in the initramfs,
that would only add it when the `deviceinfo_msm_refresher` variable was
set. However, we are able now to add files to initramfs hooks, so this
hack can be removed and simplify everything.

Changes:
* Remove `deviceinfo_msm_refresher` from all deviceinfos
* Add sanity check for it
* Move all `deviceinfo` sanity checks to an extra function
* `postmarketos-mkinitfs`: remove code for msm refresher
* `msm-fb-refresher`: add initramfs hook
2018-04-24 21:09:53 +00:00
Oliver Smith
63f921fbac pmbootstrap init: kernel selection / remove linux-pmos-lts (#1363)
* As discussed in IRC/matrix, we're removing `linux-postmarketos-lts`
  for now. The kernel isn't used right now, and we save lots of
  maintenance effort with not updating it every week or so.
* new config option `"kernel"` with possible values:
  `"downstream", "mainline", "stable"` (downstream is always
  `linux-$devicename`)
* ask for the kernel during `pmbootstrap init` if the device package
  has kernel subpackages and install it in `_install.py`
* postmarketos-mkinitfs: display note instead of exit with error when
  the `deviceinfo_dtb` file is missing (because we expect it to be
  missing for downstream kernels)
* device-sony-amami:
  * add kernel subpackages for downstream, mainline
  * set `deviceinfo_dtb`
* device-qemu-amd64: add kernel subpackages for stable, lts, mainline
* test cases and test data for new functions
* test case that checks all aports for right usage of the feature:
  * don't mix specifying kernels in depends *and* subpackages
  * 1 kernel in depends is maximum
  * kernel subpackages must have a valid name
  * Test if devices packages reference at least one kernel
* Remove `_build_device_depends_note()` which informs the user that
  `--ignore-depends` can be used with device packages to avoid building
  the kernel. The idea was to make the transition easier after a change
  we did months ago, and now the kernel doesn't always get built before
  building the device package so it's not relevant anymore.
* pmb/chroot/other.py:
  * Add autoinstall=True to kernel_flavors_installed(). When the flag
    is set, the function makes sure that at least one kernel for the
    device is installed.
  * Remove kernel_flavor_autodetect() function, wherever it was used,
    it has been replaced with kernel_flavors_installed()[0].
* pmb.helpers.frontend.py: remove code to install at least one kernel,
  kernel_flavors_installed() takes care of that now.
2018-04-03 23:50:09 +00:00
Daniele Debernardi
5f6afd3b39 Add additional files into initramfs when debug-shell is installed (#1358) 2018-03-26 18:12:58 +00:00
Daniele Debernardi
f614c9df88 Implement charging mode (#1285)
* Add charging-sdl package
* Include charging-sdl into the initramfs-extra
* [initramfs] Detect charging mode and use triggerhappy to start
charging-sdl when the power key is pressed
2018-03-05 22:59:23 +00:00
Oliver Smith
76ed56905a postmarketos-mkinitfs: don't fail without deviceinfo [skip ci] (#1269)
When building device packages, the postmarketos-mkinitfs package gets
installed as dependency of postmarketos-base. It must not try to
create an initramfs at this point, when there is not deviceinfo file.

We build the initramfs during the installation, so it's fine.

Added [skip ci] because linux kernels and KDE updates are currently
getting built for the binary repository (so Travis couldn't finish
anyway).
2018-02-26 23:57:56 +00:00
Daniele Debernardi
7cb729cbe3 Include fbdebug tool in debug-shell hook (#1266) 2018-02-26 20:32:01 +00:00
Oliver Smith
6d1af1b891 mkinitfs: Fail on missing depends / better usability in general (#1133)
* Fail if mkbootimg/uboot-tools are not installed, but creating a
  boot.img file / u-boot legacy image was requested via deviceinfo
  (fixes #312)
* Fail if /boot/dt.img is missing, but we have a qcdt device
* Fail if the dtb file specified in deviceinfo does not exist
* Fail if mkbootimg etc. exit with error code
* Don't try to add the ext4 module into the initramfs. We always
  compile it into the kernel. Instead, kconfig_check makes sure it
  is enabled now. (fixes #1037)
* Add a note that modprobe warnings can be ignored mostly
2018-01-31 19:39:09 +00:00
rrooij
bf0a5f0a21 deviceinfo: add blobtools options (#1118)
Add a blobtools option to the deviceinfo file for creating specific
blobs for the Asus TF101 tablet. This will make it easier to flash
afterwards with ADB.
2018-01-13 20:38:29 +00:00
drebrez
5c2e83f051 [initramfs] Set framebuffer mode earlier in the script (before hooks) (#1070) 2018-01-03 00:38:32 +00:00
Alex Roth
2a951d962d Add Teclast X80 Pro (EFI/x86_64 tablet) (#1050) 2017-12-29 02:02:29 +00:00
drebrez
0c63ff041c Feature debug-shell (#1028)
* Changed usb-shell behavior, it wait for some user action before continue booting
* Rename usb-shell to debug-shell and changed port to 23
* Add `20-debug-shell.sh` script to static code analysis
* Enable eth0 interface in initramfs (qemu)
* Add additional script to run a shell in order to be able to kill it from a telnet session
2017-12-23 19:22:28 +00:00
Pablo Castellano
b7d1905f30 postmarketos-mkinitfs: Handle "deviceinfo_bootimg_qcdt" boolean properly (#914) 2017-11-19 14:25:10 +00:00
drebrez
c33e5d823e Add PMOS_FORCE_PARTITION_RESIZE kernel boot parameter (#874) 2017-11-04 22:54:42 +00:00
drebrez
95b694bda3 Implement cache for initramfs-extra (#796)
Partially implements:
<https://github.com/postmarketOS/pmbootstrap/issues/411>
2017-10-22 21:00:39 +00:00
clayton craft
842db355c1 Fix #774: Don't create device-mapper mapping without subpartitions (#775)
This causes initramfs to skip calling 'kpartx' when pmOS has been
installed on an external disk (e.g. sdcard). Fixes mounting pmOS_boot
by label (#774).
2017-10-20 17:20:40 +00:00
clayton craft
c7c2b2d02a Add osk-sdl as default luks unlock mechanism on boot (#476)
More information: <https://postmarketos.org/osk-port>
2017-10-14 18:10:12 +00:00
Martijn Braam
a3375bb0ba Removed a lot of hardcoded modules in mkinitramfs (#691)
This removes a few globs from the mkinitramfs module copy part. This is an issue
in linux-postmarketos since it will copy gpu drivers for all possible hardware to the
initramfs.

This should be done in the deviceinfo variables for the modules instead and is
already done for the current devices that use module loading. This changes the
initramfs (uncompressed) from 16 MB to 11 MB just because the qemu graphics
drivers aren't included.
2017-10-04 18:16:31 +00:00
drebrez
84466cd0b6 Fix postmarketos-splash version detection during generation of splash screens (#668) 2017-10-02 22:39:09 +00:00
Attila Szöllősi
41fcf67bc5 postmarketos-base: Write /boot to /etc/fstab (#653)
Also removed fstab entry from nokia-rx51 post-install script.
2017-09-30 21:52:33 +00:00
drebrez
e303ea7cf0 Set framebuffer mode in initramfs for all devices (#652) 2017-09-29 15:22:20 +00:00
drebrez
fbc909b7f4 Implement cache for generated splash screens (#620) 2017-09-24 14:24:56 +00:00
Martijn Braam
7abec5849b Deterministic dhcp lease (#619)
* Ensure leased ip is always 172.16.42.2
* Bumped version for postmarketos-mkinitfs
2017-09-23 14:23:38 +00:00
clayton craft
1b35dd595d Improve copy in mkinitfs (#599)
'install' does not properly handle symlinks, it copies the entire file
instead of a symlink to it. This PR uses `cp -a` to preserve symlinks.

For example, with `install`, the files libc.musl-armhf.so.1 and
ld-musl-armhf.so.1 are the same size, despite the fact that in rootfs
libc.musl-armhf.so.1 is actually a symlink to ld-musl-armhf.so.1.

According to @drebrez research, the initramfs size shrunk from 
1 567 930 to 1 168 591.
2017-09-20 18:36:22 +00:00