From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7387032429685374976 X-Received: by 2002:a05:6512:3b22:b0:52c:e054:4149 with SMTP id 2adb3069b0e04-52e8266126bmr6390604e87.15.1719927516464; Tue, 02 Jul 2024 06:38:36 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:4fd4:b0:421:e8fc:1263 with SMTP id 5b1f17b1804b1-4256bbe507els19002375e9.1.-pod-prod-03-eu; Tue, 02 Jul 2024 06:38:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEva3ZeSgF2GH1bljOD4NI1So8dzeMLfa6Ppolc9gD2yxJRUhFQUEbbTQqvjg4rriRIl8PO X-Received: by 2002:a05:600c:2d42:b0:424:a5b4:6dd3 with SMTP id 5b1f17b1804b1-4257a0763fbmr65192415e9.36.1719927514496; Tue, 02 Jul 2024 06:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719927514; cv=none; d=google.com; s=arc-20160816; b=uTil++G+jP7Oqq4Lh0r/mRfg5NiVKy8ngABMw/p92zuWeB5dq0KF5TjF4AddT6CBAr 9gzlt+uQZD8OiHIQJWVwfqpXDe6HPrPX8xH6iTfO2OYbTxrMHHqtNO71NuaXhCP7rhqW YeEPh7zJi7GZoJyDkQTgSOU6gVM0dfoYSe8tikvkGD6SgnEe37faElIq1rGw/ERNnu1u sK97L+nP9iJT/LIUB4UhObBeB2bSI7nfhkX/Njzo+g5HOraj4hOBBM09WJbqS+NwAtgM rSuiJ+47CX0wjZPziEYHETD+ym3pfcx2Fg8TuuroMaFtFF6xqNVGuzL7ilMnVigU+iEh h3dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=PVyg7IZZg1Rz4E7JQsqFZ4ajhB6nqcZs7LltWveFMeQ=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=tdf4dzInSfzZ62ZritoL8wwOaB0g/ys9V+827TnHALussyJZtWyQBbuhGfPpMTXzPm X0TBpRuNMr3aT31DBQUD9hzGe9dlNNZBobKu8bsLSTSsqiyc7ND6J/jUYKFIDVP4SMwC 5r+qyzKKS2Q0gUwlcUGTBHziCEquomn/j69ZwUwMJZZDXqBIrCmYD65kro1vgz/8rjlF NxC4LW0XtB0n6TG+SN8jaTNkKzU3EQONXMYI9IHre93zjFd//EkeNoPmUMWKI/wD10Rc ETr+HaobWcIQm3F/paeWL5SAYRMfclacn74XdWYO+StQMgjmj5hSRTHzY//Gz3+uzNC1 GUiQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=eD3rEFYM; spf=pass (google.com: domain of fm-294854-20240702133834a4b34f59eb90b1a8c3-jaxsdj@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-20240702133834a4b34f59eb90b1a8c3-jaxSdj@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net. [185.136.64.226]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-4256b090706si2040335e9.1.2024.07.02.06.38.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jul 2024 06:38:34 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-294854-20240702133834a4b34f59eb90b1a8c3-jaxsdj@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) client-ip=185.136.64.226; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=eD3rEFYM; spf=pass (google.com: domain of fm-294854-20240702133834a4b34f59eb90b1a8c3-jaxsdj@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-20240702133834a4b34f59eb90b1a8c3-jaxSdj@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 20240702133834a4b34f59eb90b1a8c3 for ; Tue, 02 Jul 2024 15:38:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=PVyg7IZZg1Rz4E7JQsqFZ4ajhB6nqcZs7LltWveFMeQ=; b=eD3rEFYMgipwB/X3uthoFDYIEYqKvJrf3enhYVcQscNZX+XEMB1mFyWKdK9GtwS8Xwxz7v hUUH49sXk+OTtRZilZGXJqEKKDv1isvMP4j9i9phTKIBTW172BFADfBFHcsfxWko8bwQPQD4 5Jx79RaYITT5h2PWqAqhi4bv1WuqA=; From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH 16/17] meta-isar: deploy-image: Introduce auto-installation mode Date: Tue, 2 Jul 2024 15:38:30 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer X-TUID: /40PYqnFYVes From: Jan Kiszka If a special file called auto.install is found in the installation data directory, parse this and attempt an unattended installation. The file consists of 2 to 3 lines: - source file name - target device path - optionally, "OVERWRITE" to ignore if the target device is non-empty e.g.: $ cat /install/auto.install isar-image-base-debian-bookworm-qemuamd64.wic.zst /dev/vda OVERWRITE Errors are still stopping the process, switching it back to interactive mode. Signed-off-by: Jan Kiszka --- .../deploy-image/files/deploy-image-wic.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh b/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh index 9df93fe7..8b25b1d2 100644 --- a/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh +++ b/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh @@ -7,8 +7,20 @@ installdata=${INSTALL_DATA:-/install} AUTO_INSTALL=false +OVERWRITE= -if ! $AUTO_INSTALL; then +if [ -f "$installdata/auto.install" ]; then + exec 3<"$installdata/auto.install" + read -r DISK_IMAGE <&3 + read -r TARGET_DEVICE <&3 + read -r OVERWRITE <&3 + exec 3>&- + if [ ! -b ${TARGET_DEVICE} ]; then + dialog --msgbox "Target device is not a valid block device. Installation aborted." 6 60 + exit 1 + fi + AUTO_INSTALL=true +else DISK_IMAGE=$(find "$installdata" -type f -iname "*.wic*" -a -not -iname "*.wic.bmap" -exec basename {} \;) if [ -z "$DISK_IMAGE" ] || [ ! -f "$installdata/$DISK_IMAGE" ]; then pushd "$installdata" @@ -110,7 +122,7 @@ if ! $AUTO_INSTALL; then fi fi -if ! cmp /dev/zero "$TARGET_DEVICE" -n 1M && \ +if [ "$OVERWRITE" != "OVERWRITE" ] && ! cmp /dev/zero "$TARGET_DEVICE" -n 1M && \ ! dialog --defaultno \ --yesno "WARNING: Target device is not empty! Continue anyway?" 5 60; then exit 0 -- 2.43.0