public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "alexander.heinisch via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com, amikan@ilbers.de
Cc: Alexander Heinisch <alexander.heinisch@siemens.com>
Subject: [PATCH 2/2] isar-installer: Added config options for isar-image-installer unattended mode.
Date: Thu, 12 Dec 2024 13:53:47 +0100	[thread overview]
Message-ID: <20241212125347.76001-3-alexander.heinisch@siemens.com> (raw)
In-Reply-To: <20241212125347.76001-1-alexander.heinisch@siemens.com>

From: Alexander Heinisch <alexander.heinisch@siemens.com>

Signed-off-by: Alexander Heinisch <alexander.heinisch@siemens.com>
---
 kas/image/Kconfig                             | 37 +++++++++++++++++++
 .../images/isar-image-installer.bb            | 10 +++++
 2 files changed, 47 insertions(+)

diff --git a/kas/image/Kconfig b/kas/image/Kconfig
index e4f64dcc..0c0a664c 100644
--- a/kas/image/Kconfig
+++ b/kas/image/Kconfig
@@ -67,6 +67,43 @@ config INSTALLER_TARGET_IMAGE
 	default "isar-image-base" if INSTALL_IMAGE_BASE
 	default "isar-image-base" if INSTALL_IMAGE_DEBUG
 
+config INSTALL_UNATTENDED
+	bool "Run installer unattended"
+
+if INSTALL_UNATTENDED
+
+config INSTALLER_UNATTENDED
+	string
+	default "1" if INSTALL_UNATTENDED
+	default ""
+
+config INSTALLER_TARGET_DEVICE
+	string "Target device to deploy"
+	default "/dev/sda"
+	help
+	  Device to deploy the image onto.
+	  Leave this empty to get prompted during installation
+	  Examples: /dev/sda, /dev/nvme0n1
+
+choice
+	prompt "Overwrite handling"
+	default OPT_INSTALLER_TARGET_OVERWRITE
+
+config OPT_INSTALLER_TARGET_OVERWRITE
+	bool "Overwrite if target is not empty"
+
+config OPT_INSTALLER_TARGET_ABORT
+	bool "Abort if target is not empty"
+
+endchoice
+
+config INSTALLER_TARGET_OVERWRITE
+    string
+    default "OVERWRITE" if OPT_INSTALLER_TARGET_OVERWRITE
+    default "ABORT" if OPT_INSTALLER_TARGET_ABORT
+
+endif
+
 endif
 
 config KAS_INCLUDE_IMAGE
diff --git a/meta-isar/recipes-core/images/isar-image-installer.bb b/meta-isar/recipes-core/images/isar-image-installer.bb
index a325ab9f..ee04bb41 100644
--- a/meta-isar/recipes-core/images/isar-image-installer.bb
+++ b/meta-isar/recipes-core/images/isar-image-installer.bb
@@ -10,7 +10,17 @@ DESCRIPTION = "Example of a ISAR based Installer Image"
 # Use variable to switch easily to another wks
 INSTALLER_WKS_FILE ??= "installer-efi.wks.in"
 WKS_FILE = "${INSTALLER_WKS_FILE}"
+
 ADDITIONAL_KERNEL_CMDLINE ??= ""
+
+OVERRIDES .= "${@':unattended-installer' if d.getVar('INSTALLER_UNATTENDED') else ''}"
+ADDITIONAL_KERNEL_CMDLINE:append:unattended-installer = " \
+    installer.unattended \
+    installer.image.uri=/install/${IMAGE_DATA_FILE}.${IMAGE_DATA_POSTFIX} \
+    installer.target.dev=${INSTALLER_TARGET_DEVICE} \
+    installer.target.overwrite=${INSTALLER_TARGET_OVERWRITE} \
+    "
+
 IMAGER_INSTALL:wic:append = " ${SYSTEMD_BOOTLOADER_INSTALL}"
 
 IMAGE_INSTALL += "deploy-image-service"
-- 
2.43.0

-- 
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/20241212125347.76001-3-alexander.heinisch%40siemens.com.

  parent reply	other threads:[~2024-12-12 12:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 12:53 [PATCH v2 0/2] isar-installer: Added option to add additional kernel cmdline arguments for isar-image-installer alexander.heinisch via isar-users
2024-12-12 12:53 ` [PATCH 1/2] " alexander.heinisch via isar-users
2024-12-12 12:53 ` alexander.heinisch via isar-users [this message]
2024-12-20  7:49 ` [PATCH v2 0/2] " Uladzimir Bely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241212125347.76001-3-alexander.heinisch@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=alexander.heinisch@siemens.com \
    --cc=amikan@ilbers.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox