pmaports/main/postmarketos-mkinitfs/postmarketos-mkinitfs.trigger
Oliver Smith d757a36882
main/postmarketos-mkinitfs: fix trigger script (MR 4422)
Adjust the trigger script to only check for the new deviceinfo path. The
purpose of this check is to make sure that a full device package is
installed, and only in that case run mkinitfs. Otherwise, it will fail
because e.g. no kernels may be installed.

With recent changes, /etc/deviceinfo is a part of devicepkg-utils and
only /usr/share/deviceinfo/deviceinfo really indicates that a device
package is installed.

Remove the "exit 0" at the end while at it, it did not do anything since
the script runs with "/bin/sh -e". Add a comment to make this clear.

[ci:skip-build]: already built successfully in CI
2023-09-26 08:31:00 +02:00

8 lines
303 B
Bash

#!/bin/sh -e
# This script fails on error (-e). We don't want an error while generating the
# initramfs to go unnoticed, it may lead to the device not booting anymore.
# Only invoke mkinitfs if the deviceinfo exists in the rootfs
if [ -f /usr/share/deviceinfo/deviceinfo ]; then
/usr/sbin/mkinitfs
fi