From patchwork Fri Dec 4 14:45:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenwen Fu X-Patchwork-Id: 107332 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.10553.1796397482810970243 for ; Fri, 04 Dec 2026 07:18:02 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@qualcomm.com header.s=qcppdkim1 header.b=c1Ikp1r6; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: qualcomm.com, ip: 205.220.168.131, mailfrom: wenwfu@qualcomm.com) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B4EQjKH3534278 for ; Fri, 4 Dec 2026 14:45:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=2Xh8PluWuNDEEKL8RdZ8OXsRsG7zcXpuf0W fE3bRZI0=; b=c1Ikp1r6WH2NuGPqpge3n6BXenxmCD19ar1ZvDj6O6+rSaW7VcR e+dObKNah/n8AVW40XGSG4P93TX9SxUTYlomAcPPY2xkh2ABXNHIc9BOB72z6mfq fPn1xuCQ0yIOPLKlhuUKop/HhYW8G4Y83CpWkvv4WlauR3jgn3BJ30wlZFaZWUiw meFnZpzjST7RHceQTgbCgdr/SgSHYgO386ZhFmDHzbjcAdns3JDN+FqxEqfjp3rf B1R7lOlBh1mHQD+Lka9y7YFssoIwGp6x1MUNtBnFT/KW6r8J2pfu8b0YVgKEDFrZ 6lE+sSGJ18dmtbCnXZ+FunXEyubIy02IMTA== Received: from aptaippmta02.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com [103.229.16.4]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jbq7uhny0-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 04 Dec 2026 14:45:50 +0000 (GMT) Received: from pps.filterd (aptaippmta02.qualcomm.com [127.0.0.1]) by APTAIPPMTA02.qualcomm.com (8.18.1.11/8.18.1.11) with ESMTP id 6B4EjmAN1110090; Fri, 4 Dec 2026 14:45:48 GMT Received: from wenwfu2-gv.qualcomm.com (smtphost-taiwan.qualcomm.com [10.249.136.33]) by APTAIPPMTA02.qualcomm.com (PPS) with ESMTPS id 6B4EjmQJ1110033 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 04 Dec 2026 14:45:48 +0000 (GMT) Received: by wenwfu2-gv.qualcomm.com (Postfix, from userid 3975139) id DEBCA3F2; Fri, 4 Dec 2026 22:45:47 +0800 (CST) From: Wenwen Fu To: openembedded-core@lists.openembedded.org Cc: Wenwen Fu Subject: [PATCH 1/2] initramfs-framework: add hooks before udev settle Date: Fri, 4 Dec 2026 22:45:44 +0800 Message-ID: <20261204144545.1877630-1-wenwfu@qti.qualcomm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Proofpoint-Reinject: loops=2 maxloops=12 X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-ORIG-GUID: YuCPIg-2AhEvKyEBZ0owCA9-GhMRUXKE X-Authority-Analysis: v=2.4 cv=fo9J914f c=1 sm=1 tr=0 ts=6b12d21e cx=c_pps a=nuhDOHQX5FNHPW3J6Bj6AA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=pUM-KoujPXoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=pbqA-fOK4d2IgLAsxc4A:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjA0MDA1OCBTYWx0ZWRfXyROm54zUobis 1zlyq5B3jzoaGCojUxFvC9i42bJ9YC2w4MU0Az38haCoBW9dPLedAqNn5uy0rYtbt3qJH6wJH/h +MJngfsGfADlCThBv70G6ZrVb+hCcKckZESi+rVExKofmOOQAUVHnVASovcTbeFzpydzp9L5JKm 0mmGzak3G+AWOdzCmlbhT9eLDZv6mNaRWNgHS8axEOdRIzK8EMcGkm+MXvRYfeKgV2F5KOTd/AE /RWrO2OKAmncUhJv8tM1BAuzd/XSzVS1jpooVL9mRhps3Yb7wCmzK/xIg/vqSTtAmM0tyx6tUqZ rCh7guoCuAlf3QpnUKvZZYQwaWQxWCz9E9qToR9qbYhyMon1pIq3We8FaS8jWV6rN5YhjbusZ2r F58R4uPmPlc2WQNTGZiBtxl/k0N7JIPbb0bnG3yXjUZM0GvdI+g8oyABqP3ljVItHWhqnYGEL2E zvsxro1B/PGvIdAwKgQ== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjA0MDA1OCBTYWx0ZWRfX6BOoyWeYBlyI Rq3QAlfG6O/dsCsfYmY7d0+KKv2LgxPZmZEApueC5akCtxOyb3TtPNvJaR1yts1ZU4icd2wENOm D+P4djfo354dKwG0A6e6vnmSHGhVsFA= X-Proofpoint-GUID: YuCPIg-2AhEvKyEBZ0owCA9-GhMRUXKE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-04_03,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 clxscore=1015 suspectscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612040058 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 04 Dec 2026 15:20:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251999 Modules cannot enqueue additional devices between the initial udev trigger and its queue wait. Add a registration helper and run the hooks before settle so modules can share that wait. AI-Generated: OpenAI Codex (GPT-6) Signed-off-by: Wenwen Fu --- meta/recipes-core/initrdscripts/initramfs-framework/init | 6 ++++++ meta/recipes-core/initrdscripts/initramfs-framework/udev | 4 ++++ 2 files changed, 10 insertions(+) base-commit: 09ba457b9f2bcbf4e44bb9d262c0e1b7f4b8a707 diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/init b/meta/recipes-core/initrdscripts/initramfs-framework/init index 5dbf32a12d..27ae8ab40c 100755 --- a/meta/recipes-core/initrdscripts/initramfs-framework/init +++ b/meta/recipes-core/initrdscripts/initramfs-framework/init @@ -29,6 +29,11 @@ add_module_post_hook() { MODULE_POST_HOOKS="$MODULE_POST_HOOKS $1" } +# Register a function to enqueue devices before the udev coldplug wait. +add_udev_trigger_hook() { + UDEV_TRIGGER_HOOKS="$UDEV_TRIGGER_HOOKS $1" +} + # Load kernel module load_kernel_module() { if modprobe $1 >/dev/null 2>&1; then @@ -74,6 +79,7 @@ fatal() { ROOTFS_DIR="/rootfs" # where to do the switch root MODULE_PRE_HOOKS="" # functions to call before running each module MODULE_POST_HOOKS="" # functions to call after running each module +UDEV_TRIGGER_HOOKS="" # functions to enqueue devices before udev settle MODULES_DIR=/init.d # place to look for modules EFI_DIR=/sys/firmware/efi # place to store device firmware information diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/udev b/meta/recipes-core/initrdscripts/initramfs-framework/udev index 85c5ba1178..f39af12e08 100644 --- a/meta/recipes-core/initrdscripts/initramfs-framework/udev +++ b/meta/recipes-core/initrdscripts/initramfs-framework/udev @@ -88,5 +88,9 @@ udev_run() { else udevadm trigger --action=add fi + # Let modules enqueue additional devices before waiting for coldplug. + for udev_trigger_hook in ${UDEV_TRIGGER_HOOKS:-}; do + "$udev_trigger_hook" + done udevadm settle } From patchwork Fri Dec 4 14:45:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenwen Fu X-Patchwork-Id: 107482 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.11347.1796399588560065597 for ; Fri, 04 Dec 2026 07:53:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@qualcomm.com header.s=qcppdkim1 header.b=Bk75YLlG; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: qualcomm.com, ip: 205.220.168.131, mailfrom: wenwfu@qualcomm.com) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B4EQdNA4096416 for ; Fri, 4 Dec 2026 14:45:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=AyZCAK1Z0A8 osRtUqeTb16cburBy2tNhSaY6rdnT/tg=; b=Bk75YLlGZIVhhpKO/qUnOeJnY9N s31rl1poL40i8H5/5PxpkXrjsz1PyEfCL132IuXVSpGAcWzUH7J/GTglYbCsXnNn AOPxHf/aQlzrsXACTi232gte/KSJSl3+i5MEmKeFDU3u9xzx2tNUVesXdgON3P5k rNUVVywxCa9m7RrfcACWY358H/8Bdr310T0ZdTan6/qeaY6cS4KpMXXI7PNag1Ca sDgevRBopQXetSCwdDkQR6NZQop3JmKEXyz7Ya2n4EYpWBckEG+y1TGvp0k+5kmm lQDY1meUMBOy6yOTR2h9Ozf4++DFf/mq2QVFdniQXyHbOkc4qzrVGD7yM8w== Received: from aptaippmta02.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com [103.229.16.4]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jbq7qsppg-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 04 Dec 2026 14:45:52 +0000 (GMT) Received: from pps.filterd (aptaippmta02.qualcomm.com [127.0.0.1]) by APTAIPPMTA02.qualcomm.com (8.18.1.11/8.18.1.11) with ESMTP id 6B4EjmPv1110087 for ; Fri, 4 Dec 2026 14:45:51 GMT Received: from wenwfu2-gv.qualcomm.com (smtphost-taiwan.qualcomm.com [10.249.136.33]) by APTAIPPMTA02.qualcomm.com (PPS) with ESMTPS id 6B4EjoDW1110303 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 04 Dec 2026 14:45:50 +0000 (GMT) Received: by wenwfu2-gv.qualcomm.com (Postfix, from userid 3975139) id 83F003F2; Fri, 4 Dec 2026 22:45:50 +0800 (CST) From: Wenwen Fu To: openembedded-core@lists.openembedded.org Cc: Wenwen Fu Subject: [PATCH 2/2] initramfs-module-earlyesp: add optional ESP coldplug Date: Fri, 4 Dec 2026 22:45:45 +0800 Message-ID: <20261204144545.1877630-2-wenwfu@qti.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261204144545.1877630-1-wenwfu@qti.qualcomm.com> References: <20261204144545.1877630-1-wenwfu@qti.qualcomm.com> MIME-Version: 1.0 X-Proofpoint-Reinject: loops=2 maxloops=12 X-QCInternal: smtphost X-QCInternal: smtphost X-Authority-Analysis: v=2.4 cv=Ne9zRGD4 c=1 sm=1 tr=0 ts=6b12d221 cx=c_pps a=nuhDOHQX5FNHPW3J6Bj6AA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=pUM-KoujPXoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=iGHA9ds3AAAA:8 a=pax9_ZVbSW9G7Ic5URsA:9 a=nM-MV4yxpKKO9kiQg6Ot:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjA0MDA1OCBTYWx0ZWRfX0TLWAMkZMy1y TpHOFEpBcYeX+XcPQ19YDoCaFBeUJKohQcyxs8udKO9Ut4heWDjo+WAdQb0rISuoGoyBoR/Bi0U ICQNxWHBr8Fva+0K4gyD51XCA3CwlbiyJssJcvh/JrGIiTW6zh1NqXjgoEVnaBWQjTZ1ebphlOf X1B3ysIo6gu+xo7H+mKUJUc7JvsfUUhBhcVXgj/mUXtSSiJJiIQdtGO8MWJ/uRhQ8uQEC2IedcY x6tDy3LE3B7MFSo4TCFQbFx/EWo2dvYBengaMh0EQtJ8uY0EpwjNDmxVzbGcvQ870FPZ3GgqvNx vyFFNwXvG+UH2uNijVQdrszntt66zi1pdgqv8/kHl22+TAwCgcDkLnrPJB/DOYsUS/Eaeg5jlNL 6sVqACHMAzKq3b3tznpqsGwTAcJDJKtewq4AAcV8jJaUAielxUvsMdxV7nRU6ueCI0X6BF7TZiq xcp4kYdrmU1pI2yqL6A== X-Proofpoint-ORIG-GUID: UH4LKUlK7XEmapQQ6poK_lECW-_qMeZv X-Proofpoint-Spam-Info: AW1haW4tMjYxMjA0MDA1OCBTYWx0ZWRfXzZ20wJrq/w1M m6ylSqMzDduL97p3xMoWTbnH8yx0orT8gEVkPs3oQJGHpZnK4xzzqhSG1FnWfQwVqtoUoa9UoyH YhKsvlbpKaCZFayAKgZBYVT09Zk1XHM= X-Proofpoint-GUID: UH4LKUlK7XEmapQQ6poK_lECW-_qMeZv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-04_03,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 malwarescore=0 clxscore=1015 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612040058 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 04 Dec 2026 20:09:07 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/252105 With root-only coldplug, the ESP can remain unprocessed until the real root coldplug, delaying systemd units that require it. Add an optional module selected by initramfs.esp-partlabel that validates the GPT type and vfat filesystem through udev before the shared queue wait. AI-Generated: OpenAI Codex (GPT-6) Signed-off-by: Wenwen Fu --- meta/conf/distro/include/maintainers.inc | 1 + .../initramfs-module-earlyesp/earlyesp | 54 +++++++++++++++++++ .../initramfs-module-earlyesp_1.0.bb | 21 ++++++++ 3 files changed, 76 insertions(+) create mode 100644 meta/recipes-core/initrdscripts/initramfs-module-earlyesp/earlyesp create mode 100644 meta/recipes-core/initrdscripts/initramfs-module-earlyesp_1.0.bb diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 9b3011e61f..8b8e691ea8 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -287,6 +287,7 @@ RECIPE_MAINTAINER:pn-initramfs-live-install = "Unassigned . + +earlyesp_enabled() { + earlyesp_label=${bootparam_initramfs_esp_partlabel:-off} + # Keep the label safe to embed literally in a udev rule. + case "$earlyesp_label" in + ""|off|*[!A-Za-z0-9_.-]*) return 1 ;; + esac + [ "${#earlyesp_label}" -le 36 ] +} + +earlyesp_trigger() { + if ! udevadm trigger --type=devices --action=add "$earlyesp_path"; then + msg "WARNING: Could not trigger early ESP processing; continuing normal boot." + fi + return 0 +} + +earlyesp_run() { + earlyesp_path= + # Read the kernel PARTNAME, without needing a udev database, filesystem + # scan, efivarfs mount or a fixed disk name. + for earlyesp_candidate in /sys/class/block/*; do + [ -r "$earlyesp_candidate/partition" ] || continue + [ -r "$earlyesp_candidate/uevent" ] || continue + earlyesp_candidate_label= + while IFS='=' read -r earlyesp_key earlyesp_value; do + [ "$earlyesp_key" = "PARTNAME" ] && earlyesp_candidate_label=$earlyesp_value + done < "$earlyesp_candidate/uevent" + [ "$earlyesp_candidate_label" = "$earlyesp_label" ] || continue + # Never choose an arbitrary disk when partition labels are duplicated. + [ -z "$earlyesp_path" ] || return 0 + earlyesp_path=$earlyesp_candidate + done + [ -n "$earlyesp_path" ] || return 0 + + # Install before udevd starts so no rule reload is needed. /etc here + # belongs to the initramfs; only the resulting /run/udev state survives + # switch_root. Let blkid validate both the GPT type and filesystem. + mkdir -p /etc/udev/rules.d || return 0 + if ! printf '%s\n' \ + 'ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", \' \ + "ENV{PARTNAME}==\"$earlyesp_label\", \\" \ + 'ENV{ID_PART_ENTRY_TYPE}=="c12a7328-f81f-11d2-ba4b-00a0c93ec93b", \' \ + 'ENV{ID_FS_TYPE}=="vfat", TAG+="systemd"' \ + > /etc/udev/rules.d/99-early-esp.rules; then + return 0 + fi + # Enqueue the ESP before the udev module's existing coldplug wait. + add_udev_trigger_hook earlyesp_trigger +} diff --git a/meta/recipes-core/initrdscripts/initramfs-module-earlyesp_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-module-earlyesp_1.0.bb new file mode 100644 index 0000000000..c46e834bdb --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-module-earlyesp_1.0.bb @@ -0,0 +1,21 @@ +SUMMARY = "Prepare an EFI System Partition for systemd in initramfs" +DESCRIPTION = "Optional initramfs-framework module that processes an EFI \ +System Partition selected by initramfs.esp-partlabel and tags it for \ +the real-root systemd manager." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +SRC_URI = "file://earlyesp" +S = "${UNPACKDIR}" + +inherit features_check + +REQUIRED_DISTRO_FEATURES = "systemd" + +RDEPENDS:${PN} = "initramfs-module-udev util-linux-libblkid" + +do_install() { + install -D -m 0755 ${S}/earlyesp ${D}/init.d/00-earlyesp +} + +FILES:${PN} = "/init.d/00-earlyesp"