From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 01 Jul 2026 11:04:21 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f64.google.com (mail-lf1-f64.google.com [209.85.167.64]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 66194K2O004304 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 1 Jul 2026 11:04:20 +0200 Received: by mail-lf1-f64.google.com with SMTP id 2adb3069b0e04-5aa68eb0a1asf301408e87.3 for ; Wed, 01 Jul 2026 02:04:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1782896655; cv=pass; d=google.com; s=arc-20260327; b=c/ni6K4l+So1AiEY1vl7DLxJ9sRDoOAC0cRo+/QwqNkk5daPpEOdsBNKd6r/jroo80 /rAlBrT5quSB4j4laX8boWrewUo3RoW22sl9TvIJNbDQiLCNVGW7GgcMMRNxboWFYG2M As7vZ/nxmdQojMcMxrkwCXOTc23sRiQvUHR3YV4k0DHcLNVOj/D4EGBCmwDYkuVCuEJH TIzoUV+jz7hUlmA10yHFTc+D4AJq1wwApsAInBy0Wbw8rf+4uU3UVC45iRjijkrOl9Rc fas5++MtQ3+Z2agXj94+dkDGGTfvgZGrPf5FC+5LcQyLROC8JDTObK7x7IXuq65d7UpX wj/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:dkim-signature; bh=b3+KKF+CokFV+ltkE9YyWpNxVeFFIFuQ8W3rKEDcaFk=; fh=acg9x/OhTEiX/dNkm9raoxU2ayqASEtqg+Mk93HXcak=; b=E/wOl8nRe9OXzwM2pN63GXVmTyEF5yYszrAQQxd1xSWMvEEvmkxffXu950mwUe8d5m RptyJ/DaNJvGWuufM29d0rQWAHOiPRCGjgJ/EeIMIXZbKwFrWUdZEbEqN4wPXdNj37wz WoMLXQ2W0Ffm2IB+SDK988+STbbOuI3kMeNRB3Ey6sCXOVcmKyPTH231QKYACSGtipmD Dz8FYkRC8xE0P2ryNcclt4JR9mNnBuBMifmpRo04Hdi9AlT0WxC47ldw3ppFv30gCbwb Q85Cf8875QtGPD0toMSf6bisi6ZfPmTFGoxxb5P3/olH/9lu6oaPfI/1bniLQvVup8af CyuA==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20251104; t=1782896655; x=1783501455; darn=ilbers.de; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:in-reply-to:from:content-language:references:to :subject:user-agent:mime-version:date:message-id:sender:from:to:cc :subject:date:message-id:reply-to; bh=b3+KKF+CokFV+ltkE9YyWpNxVeFFIFuQ8W3rKEDcaFk=; b=l3MAxNdnsSj9bYXopnAGZ7MejNLgXNTdXT0PaZOjaWbvr/ApUjgFES38JhCAwq50AV 0Ui+oLblckvn35m7G6VjVuZ/GSKgdhllQkZKwx/OQkvYaKgqSEOnZCOvOnbWtmUtYzUf xooIXJIG4J7vf5grnCjxVvGGuS/vpRPtrzZJfSmhWQPc5u6Mo58oKN6bVOgP589DYe8V OB8s/vUhZ7R8P0RVJaOvcPUkMHpNO6pRICQ1ueIgGdKbn7U+ay0p0z98+oohCirghaYL Q+Z2jznDUuDTPISx9cJuLjtx1axxLMlgPdtWe3utkhNOSWMbwnpoN7kNDE3jZUgbTR1c 4mPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782896655; x=1783501455; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:in-reply-to :from:content-language:references:to:subject:user-agent:mime-version :date:message-id:x-beenthere:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=b3+KKF+CokFV+ltkE9YyWpNxVeFFIFuQ8W3rKEDcaFk=; b=Xi94LrjsEQ5IfjMrybUwfPGTWhO1t7C10huqZUXnB5lgAAPDjEWow9HUbKNweTesYk elRSby+1xSvrJb5JiRJE1oF8pdeuOdJ+aICGcW0AWxjZmnMe+iCY+3Rk2UE9DmKoAl/l M+MikRXhYspuk21n2OOXdi8zhZqUvJWI1lbGBXsUOdukeSctUjura9MpB5tO3QWruOJH iGpiYR5d3zqTLs3ebwpkPMoblwyF4MG3I+W1EcQaoyWxn09DLOK4hY0X/QO2fpYWX4Ha X5kZCmp3VXQvUtzJTYtNOwQ8OiNmPqYiSiyjMdhgbFDOLP/HzLtwuEiSPIM2Fd0YZM6I VtcA== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AHgh+RpK7CitNrWQQLmezfS/j3lCW39MxPw/lT/yQ7HXM3ABZXJJ6drNQWkThubJTCLLnRBtk5Ow@ilbers.de X-Gm-Message-State: AOJu0YxsnOeu0SyHRR/tILnw4R+Z4Q37lTpvzEmRZQk6OVgtVuCcPJdR 31BaGjwWpJyAootB+O9WRyjLYizkXtxk6Xqa3Fpt6nPRhCJSaw0q8UwI X-Received: by 2002:a05:6512:4042:b0:5ae:b130:1e1 with SMTP id 2adb3069b0e04-5aec67aa650mr198329e87.28.1782896654746; Wed, 01 Jul 2026 02:04:14 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h="AX0PUUfbpwaJWWr/msEtmQ8k5oBMTHFL+vfq0z41ylYjmQ53mg==" Received: by 2002:a05:6512:144a:10b0:5ad:4ef1:7c37 with SMTP id 2adb3069b0e04-5aec35fef4bls152418e87.1.-pod-prod-05-eu; Wed, 01 Jul 2026 02:04:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+RpivNZWc6Sq9ZYG7VemGplxT0gbUVnt0UCkhfMpVQKesMlouxhATIuTlZPfd4jk15eyRihCmhD4Wti7@googlegroups.com X-Received: by 2002:a05:6512:461b:b0:5ae:b2cf:8204 with SMTP id 2adb3069b0e04-5aec6795b1cmr167063e87.2.1782896652102; Wed, 01 Jul 2026 02:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782896652; cv=none; d=google.com; s=arc-20260327; b=LvJxTDsJavnPfruRSSk0jd1Nw8AHb2DvjJckH6bor2Z7tLScDkMC2uYP38MfO7/qN4 N+uvKVoMvYFUHBuJPo0Xui4z8CQle6eTJqz2sUtFATY6WsElHYP03v09rnNRZYi3fO6P 6nc58OmebjTquOfL2LkGk9XA21INpvo18j99ctxTpfXk4h8sqqI86vXPc25ct2tSxhsK PEs8cCzIuSG6vTWCpcQVvS2pbAUaUzJZ08oyBN+jQ+GMdw5VMjdsbdezHuHO5bWe/rEM DDsPDGZ5NROws0LQ2oJLeyonSIbT7aucQ5fOiexg/CWZURzDG68C+ZoG85n3IuYq/t0Y 65eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id; bh=R2Cy1lbvcVYr9+tAN5ghUzIXjnHW9AULICc/bWvehY8=; fh=byKKdcbJp0+UUfq7yDydjZvMiyS2ZBGGumi2piBKjbU=; b=FJw+ZveF1ZzBs6P5g4UHDwXdCIKnWEKmXlFHyCPaC0PTwUGBg8M8qcbb0OSH2dN+LF wVOkh+jp74OGsSCt+Cvn0eOHYdX5UABKNjln5NqqhlhQU69lh0+OZhi1ljFX8WHN5Rxj ztkojbMsShm+LhsgRpoZL1GYwFRT0xfJAQJJGcgsXhbXIwgINeelciDvHfh0n0bxNu8y dETpnYw+48t/gspffvCbs7TJYpfa2c/0DkZx6iA6yRy6CQZLR2RwEcZnBZAG17c9ZwNA 9Bp0V+Xo8LWxVwvcMYwjtrPpqXEvZ2z7rr8tZgxeMj1FiVlXijOin07GjApOhWZnfS6H iqlA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 38308e7fff4ca-39b2f9b596csi276971fa.8.2026.07.01.02.04.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Jul 2026 02:04:12 -0700 (PDT) Received-SPF: pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from [192.168.178.148] ([88.130.203.42]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 661948hP004292 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 1 Jul 2026 11:04:09 +0200 Message-ID: Date: Wed, 1 Jul 2026 11:04:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] target-bootstrapper-service: add runtime serial tty drop-in generation To: Gourav Singh , isar-users@googlegroups.com References: <20260619103944.1303513-1-gouravsingh@siemens.com> Content-Language: en-US From: Zhihang Wei In-Reply-To: <20260619103944.1303513-1-gouravsingh@siemens.com> Content-Type: text/plain; charset="UTF-8"; format=flowed X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-Original-Sender: wzh@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-TUID: drq8Xkxvph6x Applied to next, thanks. Zhihang On 6/19/26 12:39, 'Gourav Singh' via isar-users wrote: > Extend the recipe to support dynamically detected serial consoles without > taking over every getty instance. > > The existing loop still installs overrides for statically configured > TARGET_BOOTSTRAPPER_TTY_SERVICES. In addition, a runtime oneshot service > and helper script are installed to detect the first available serial tty > (ttyACM*/ttyUSB*/ttyAMA*/ttyGS*) and create one matching > serial-getty@.service.d override from a stored template. > > This keeps installer behavior on configured ttys, adds support for > runtime-discovered serial devices, and preserves other consoles for > normal login/debug access. > > Signed-off-by: Gourav Singh > --- > .../generate-target-bootstrapper-dropin.sh | 47 +++++++++++++++++++ > .../files/postinst.tmpl | 3 ++ > ...arget-bootstrapper-generate-dropin.service | 12 +++++ > .../target-bootstrapper-service.bb | 14 +++++- > 4 files changed, 74 insertions(+), 2 deletions(-) > create mode 100644 meta-isar/recipes-installer/target-bootstrapper-service/files/generate-target-bootstrapper-dropin.sh > create mode 100644 meta-isar/recipes-installer/target-bootstrapper-service/files/target-bootstrapper-generate-dropin.service > > diff --git a/meta-isar/recipes-installer/target-bootstrapper-service/files/generate-target-bootstrapper-dropin.sh b/meta-isar/recipes-installer/target-bootstrapper-service/files/generate-target-bootstrapper-dropin.sh > new file mode 100644 > index 00000000..50c3ba40 > --- /dev/null > +++ b/meta-isar/recipes-installer/target-bootstrapper-service/files/generate-target-bootstrapper-dropin.sh > @@ -0,0 +1,47 @@ > +#!/bin/sh > +# This software is a part of Isar. > +# Copyright (C) Siemens AG, 2026 > +# > +# SPDX-License-Identifier: MIT > + > +set -e > + > +OVERRIDE_DIR="/usr/lib/systemd/system" > +DROP_IN_SUFFIX="d/10-target-bootstrapper.override.conf" > + > +# Check if override template exists > +if [ ! -f "/usr/lib/target-bootstrapper.override.conf" ]; then > + exit 0 > +fi > + > +# Detect first available serial device (ttyACM*, ttyUSB*, ttyAMA*, etc.) > +detect_first_serial_device() { > + for pattern in ttyACM ttyUSB ttyAMA ttyGS; do > + for dev in /dev/${pattern}*; do > + if [ -c "$dev" ]; then > + basename "$dev" > + return 0 > + fi > + done > + done > +} > + > +DETECTED_TTY=$(detect_first_serial_device 2>/dev/null) > + > +if [ -z "$DETECTED_TTY" ]; then > + exit 0 > +fi > + > +# Map device name to getty service instance > +# e.g. ttyACM0 -> serial-getty@ttyACM0.service > +TTY_SERVICE="serial-getty@${DETECTED_TTY}.service" > +DROP_IN_DIR="${OVERRIDE_DIR}/${TTY_SERVICE}.d" > + > +# Create drop-in directory and install override > +mkdir -p "$DROP_IN_DIR" > +cp "/usr/lib/target-bootstrapper.override.conf" "$DROP_IN_DIR/${DROP_IN_SUFFIX##*/}" > + > +# Reload systemd to pick up new drop-ins > +systemctl daemon-reload || true > + > +exit 0 > diff --git a/meta-isar/recipes-installer/target-bootstrapper-service/files/postinst.tmpl b/meta-isar/recipes-installer/target-bootstrapper-service/files/postinst.tmpl > index 7c24af17..57851956 100644 > --- a/meta-isar/recipes-installer/target-bootstrapper-service/files/postinst.tmpl > +++ b/meta-isar/recipes-installer/target-bootstrapper-service/files/postinst.tmpl > @@ -5,3 +5,6 @@ set -e > for tty_service in ${TARGET_BOOTSTRAPPER_TTY_SERVICES}; do > deb-systemd-helper enable ${tty_service} || true > done > + > +# Enable the runtime detection service > +deb-systemd-helper enable target-bootstrapper-generate-dropin.service || true > diff --git a/meta-isar/recipes-installer/target-bootstrapper-service/files/target-bootstrapper-generate-dropin.service b/meta-isar/recipes-installer/target-bootstrapper-service/files/target-bootstrapper-generate-dropin.service > new file mode 100644 > index 00000000..38457c8d > --- /dev/null > +++ b/meta-isar/recipes-installer/target-bootstrapper-service/files/target-bootstrapper-generate-dropin.service > @@ -0,0 +1,12 @@ > +[Unit] > +Description=Generate target-bootstrapper drop-in for detected serial devices > +Before=serial-getty@.service getty@.service > +After=dev-*.device > + > +[Service] > +Type=oneshot > +ExecStart=/usr/libexec/target-bootstrapper-service/generate-target-bootstrapper-dropin.sh > +RemainAfterExit=yes > + > +[Install] > +WantedBy=multi-user.target > diff --git a/meta-isar/recipes-installer/target-bootstrapper-service/target-bootstrapper-service.bb b/meta-isar/recipes-installer/target-bootstrapper-service/target-bootstrapper-service.bb > index e7a8b2a1..572cddcd 100644 > --- a/meta-isar/recipes-installer/target-bootstrapper-service/target-bootstrapper-service.bb > +++ b/meta-isar/recipes-installer/target-bootstrapper-service/target-bootstrapper-service.bb > @@ -25,6 +25,8 @@ inherit dpkg-raw > SRC_URI = "\ > file://postinst.tmpl \ > file://target-bootstrapper.override.conf \ > + file://generate-target-bootstrapper-dropin.sh \ > + file://target-bootstrapper-generate-dropin.service \ > " > > TEMPLATE_FILES = "postinst.tmpl" > @@ -33,11 +35,19 @@ TEMPLATE_VARS = "TARGET_BOOTSTRAPPER_TTY_SERVICES" > DEPENDS += " target-bootstrapper" > DEBIAN_DEPENDS = "target-bootstrapper" > > -do_install[cleandirs] = "${D}/usr/lib/systemd/system/" > +do_install[cleandirs] = "${D}/usr/lib/systemd/system/ ${D}/usr/libexec" > do_install() { > for svc_name in ${TARGET_BOOTSTRAPPER_TTY_SERVICES} > do > - mkdir -p ${D}/usr/lib/systemd/system/${svc_name}.service.d/ > + install -d -m 0755 ${D}/usr/lib/systemd/system/${svc_name}.service.d/ > install -m 0644 ${WORKDIR}/target-bootstrapper.override.conf ${D}/usr/lib/systemd/system/${svc_name}.service.d/10-target-bootstrapper.override.conf > done > + > + # Install script and service for runtime detection of serial devices > + install -d -m 0755 ${D}/usr/libexec/${PN}/ > + install -m 0755 ${WORKDIR}/generate-target-bootstrapper-dropin.sh ${D}/usr/libexec/${PN}/ > + install -m 0644 ${WORKDIR}/target-bootstrapper-generate-dropin.service ${D}/usr/lib/systemd/system/ > + > + # Install override template for runtime use by the detection script > + install -m 0644 ${WORKDIR}/target-bootstrapper.override.conf ${D}/usr/lib/target-bootstrapper.override.conf > } -- You received this message because you are subscribed to the Google Groups "isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/isar-users/b0db2afd-d5eb-491b-80cc-07e467323ef9%40ilbers.de.