Skip to content
Snippets Groups Projects
Verified Commit 3240d9fd authored by Oliver Smith's avatar Oliver Smith Committed by Clayton Craft
Browse files

main/postmarketos-mkinitfs: trigger: add skip hint (MR 6325)

The recent optimization of not running "mkinitfs" during the trigger
script when running in pmbootstrap lead to unexpected behavior for some
use cases: testing initramfs changes and upgrading the initramfs in the
chroot (e.g. with pmbootstrap chroot --image). Let the user know that it
gets skipped and tell them how they can force building a new initramfs,
as discussed with Caleb.

[ci:skip-build]: already built successfully in CI
parent 1cd8b92b
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-mkinitfs
pkgver=2.6.1
pkgrel=1
pkgrel=2
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org"
depends="
......
......@@ -2,12 +2,19 @@
# 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.
# Conditionally run mkinitfs:
# * Only invoke mkinitfs if the deviceinfo exists in the rootfs.
# * Don't run mkinitfs inside "pmbootstrap install" with this trigger script,
# as it would trigger multiple times as the rootfs gets constructed, slowing
# down the process. Instead, pmbootstrap runs "mkinitfs" explicitly once at
# the end of "pmbootstrap install".
if [ -f /usr/share/deviceinfo/deviceinfo ] && ! [ -f /in-pmbootstrap ]; then
/usr/sbin/mkinitfs
if ! [ -f /usr/share/deviceinfo/deviceinfo ]; then
echo "mkinitfs: skipping (no deviceinfo file found)"
exit 0
fi
# Don't run mkinitfs inside "pmbootstrap install" with this trigger script, as
# it would trigger multiple times as the rootfs gets constructed, slowing down
# the process. Instead, pmbootstrap runs "mkinitfs" explicitly once at the end
# of "pmbootstrap install".
if [ -f /in-pmbootstrap ]; then
echo "mkinitfs: skipping (running in pmbootstrap)"
echo "mkinitfs: to force building a new initramfs, run 'mkinitfs'"
exit 0
fi
/usr/sbin/mkinitfs
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment