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"