From 118a30935e5e957f7d20cd900cdbe31ade12d33a Mon Sep 17 00:00:00 2001
From: Caleb Connolly <caleb@postmarketos.org>
Date: Wed, 10 Apr 2024 02:08:02 +0200
Subject: [PATCH] postmarketos-initramfs: mount subpartitions after hooks (MR
 5000)

This step is the most likely to go wrong or have issues, and it has side
effects which can make it difficult to run multiple times on one boot.
Move it to after hooks so that e.g. when dropping to a debug shell, we
land before the first call.

This also makes booting to hooks a faster in many cases.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
---
 main/postmarketos-initramfs/init.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/main/postmarketos-initramfs/init.sh b/main/postmarketos-initramfs/init.sh
index 4f2c098f0f7..5987eb5aaaf 100644
--- a/main/postmarketos-initramfs/init.sh
+++ b/main/postmarketos-initramfs/init.sh
@@ -34,7 +34,6 @@ if [ "$IN_CI" = "false" ]; then
 	show_splash "Loading..."
 	setup_mdev
 	setup_dynamic_partitions "${deviceinfo_super_partitions:=}"
-	mount_subpartitions
 else
 	# loads all modules
 	setup_udev
@@ -53,6 +52,8 @@ fi
 setup_usb_network
 start_unudhcpd
 
+mount_subpartitions
+
 wait_boot_partition
 mount_boot_partition /boot
 extract_initramfs_extra /boot/initramfs-extra
-- 
GitLab