From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7329816413997105152 Date: Wed, 7 Feb 2024 10:00:48 -0800 (PST) From: John W To: isar-users Message-Id: In-Reply-To: <20240130091108.511214-1-Quirin.Gylstorff@siemens.com> References: <20240130091108.511214-1-Quirin.Gylstorff@siemens.com> Subject: Re: [PATCH] add simple installer to isar MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_32824_1461885065.1707328848507" X-TUID: N5wcueL+6yic ------=_Part_32824_1461885065.1707328848507 Content-Type: multipart/alternative; boundary="----=_Part_32825_510951198.1707328848507" ------=_Part_32825_510951198.1707328848507 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks for sharing this patch! In the deploy-image-wic.sh script there's the following line: +TARGET_DEVICE=3D$(echo "${1}" | tr -d " ")=20 That will cause the detected drives to merge into one string, e.g. "sda=20 sdb" to "sdasdb" and cause installation failure.=20 Regards, John On Tuesday, January 30, 2024 at 1:11:13=E2=80=AFAM UTC-8 Quirin Gylstorff w= rote: > From: Quirin Gylstorff > > This is a example to create installer image which contains another > target image. It uses a multiconfig aproach to seperate the settings > of the installer from the target settings. > > Signed-off-by: Quirin Gylstorff > --- > kas/image/Kconfig | 14 ++++ > kas/image/isar-image-installer.yaml | 13 +++ > .../conf/multiconfig/installer-target.conf | 6 ++ > .../conf/multiconfig/isar-installer.conf | 5 ++ > .../images/isar-image-installer.bb | 17 ++++ > .../deploy-image/deploy-image_0.1.bb | 21 +++++ > .../deploy-image/files/deploy-image-wic.sh | 83 +++++++++++++++++++ > .../deploy-image/files/install.override.conf | 5 ++ > .../store-target-image_0.1.bb | 19 +++++ > .../lib/wic/canned-wks/installer-efi.wks.in | 9 ++ > 10 files changed, 192 insertions(+) > create mode 100644 kas/image/isar-image-installer.yaml > create mode 100644 meta-isar/conf/multiconfig/installer-target.conf > create mode 100644 meta-isar/conf/multiconfig/isar-installer.conf > create mode 100644 meta-isar/recipes-core/images/isar-image-installer.bb > create mode 100644 meta-isar/recipes-installer/deploy-image/ > deploy-image_0.1.bb > create mode 100644=20 > meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh > create mode 100644=20 > meta-isar/recipes-installer/deploy-image/files/install.override.conf > create mode 100644 meta-isar/recipes-installer/store-target-image/ > store-target-image_0.1.bb > create mode 100644 meta-isar/scripts/lib/wic/canned-wks/ > installer-efi.wks.in > > diff --git a/kas/image/Kconfig b/kas/image/Kconfig > index 8e617386..be6d7019 100644 > --- a/kas/image/Kconfig > +++ b/kas/image/Kconfig > @@ -22,11 +22,25 @@ config IMAGE_DEBUG > help > This image includes some tools preinstalled useful for debug. > > +menuconfig IMAGE_INSTALLER > + bool "Installer image" > + help > + This image contains a target image and scripts to install that target= =20 > image on a device. > + > +config INSTALLER_TARGET_IMAGE > + string "Install Base or Debug image" > + default "isar-image-base" > + help > + This selects the target image of the installer: > + - isar-image-base > + - isar-image-debug > + depends on IMAGE_INSTALLER > endchoice > > config KAS_INCLUDE_IMAGE > string > default "kas/image/isar-image-base.yaml" if IMAGE_BASE > default "kas/image/isar-image-debug.yaml" if IMAGE_DEBUG > + default "kas/image/isar-image-installer.yaml" if IMAGE_INSTALLER > > endmenu > diff --git a/kas/image/isar-image-installer.yaml=20 > b/kas/image/isar-image-installer.yaml > new file mode 100644 > index 00000000..f9a3d346 > --- /dev/null > +++ b/kas/image/isar-image-installer.yaml > @@ -0,0 +1,13 @@ > +# This software is a part of ISAR. > +# Copyright (C) Siemens AG, 2024 > +# > +# SPDX-License-Identifier: MIT > + > +header: > + version: 14 > + > +target: isar-image-installer > + > +local_conf_header: > + installer_multiconfig: | > + BBMULTICONFIG +=3D "installer-target" > diff --git a/meta-isar/conf/multiconfig/installer-target.conf=20 > b/meta-isar/conf/multiconfig/installer-target.conf > new file mode 100644 > index 00000000..254c91a6 > --- /dev/null > +++ b/meta-isar/conf/multiconfig/installer-target.conf > @@ -0,0 +1,6 @@ > +# This software is a part of ISAR. > +# Copyright (C) Siemens AG, 2024 > +# > +# SPDX-License-Identifier: MIT > + > +IMAGE_FSTYPES +=3D "wic.xz" > diff --git a/meta-isar/conf/multiconfig/isar-installer.conf=20 > b/meta-isar/conf/multiconfig/isar-installer.conf > new file mode 100644 > index 00000000..11afcb85 > --- /dev/null > +++ b/meta-isar/conf/multiconfig/isar-installer.conf > @@ -0,0 +1,5 @@ > +# This software is a part of ISAR. > +# Copyright (C) Siemens AG, 2024 > +# > +# SPDX-License-Identifier: MIT > + > diff --git a/meta-isar/recipes-core/images/isar-image-installer.bb=20 > b/meta-isar/recipes-core/images/isar-image-installer.bb > new file mode 100644 > index 00000000..27de03d5 > --- /dev/null > +++ b/meta-isar/recipes-core/images/isar-image-installer.bb > @@ -0,0 +1,17 @@ > +# This software is a part of ISAR. > +# Copyright (C) Siemens AG, 2024 > +# > +# SPDX-License-Identifier: MIT > + > +inherit image > +DESCRIPTION =3D "Example of a ISAR based Installer Image" > + > +# Use variable to switch easily to another wks > +INSTALLER_WKS_FILE ??=3D "installer-efi.wks.in" > +WKS_FILE =3D "${INSTALLER_WKS_FILE}" > +IMAGER_INSTALL:wic:append =3D " systemd-boot" > + > +IMAGE_INSTALL +=3D "store-target-image" > +IMAGE_INSTALL +=3D "deploy-image" > + > +IMAGE_INSTALL:remove =3D "expand-on-first-boot" > diff --git a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb= =20 > b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb > new file mode 100644 > index 00000000..9bf25445 > --- /dev/null > +++ b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb > @@ -0,0 +1,21 @@ > +# This software is a part of ISAR. > +# Copyright (C) Siemens AG, 2024 > +# > +# SPDX-License-Identifier: MIT > + > +DESCRIPTION =3D "add target image to rootfs" > + > + > +inherit dpkg-raw > + > +SRC_URI =3D "file://deploy-image-wic.sh \ > + file://install.override.conf \ > + " > +DEPENDS =3D "store-target-image" > +DEBIAN_DEPENDS =3D "store-target-image, bmap-tools, pv, dialog, util-lin= ux,=20 > parted, fdisk, gdisk, pigz, xz-utils, pbzip2" > +do_install[cleandirs] =3D "${D}/usr/bin/ \ > + ${D}/etc/systemd/system/ge...@tty1.service.d/" > +do_install() { > + install -m 0755 ${WORKDIR}/deploy-image-wic.sh=20 > ${D}/usr/bin/deploy-image-wic.sh > + install -m 0755 ${WORKDIR}/install.override.conf=20 > ${D}/etc/systemd/system/ge...@tty1.service.d/override.conf > +} > diff --git=20 > a/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh=20 > b/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh > new file mode 100644 > index 00000000..0d1f4ba8 > --- /dev/null > +++ b/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh > @@ -0,0 +1,83 @@ > +#!/bin/bash > +# This software is a part of ISAR. > +# Copyright (C) Siemens AG, 2024 > +# > +# SPDX-License-Identifier: MIT > + > +DISK_IMAGE=3D$(find /install -type f -iname "*.wic*" -a -not -iname=20 > "*.wic.bmap") > +DISK_BMAP=3D$(find /install -type f -iname "$DISK_IMAGE.bmap") > +DISK_IMAGE_SIZE=3D$(cat /install/*_size) > +if [ "$DISK_IMAGE_SIZE" -gt "$(( 4096 * 1024 * 1024 ))" ]; then > + echo "IMAGE_SIZE: '$DISK_IMAGE_SIZE' is to big for vfat" > +fi > + > +# inspired by poky/meta/recipes-core/initrdscripts/files/install-efi.sh > + > +target_device_list=3D"" > +current_root_dev=3D$(grep "[[:blank:]]/[[:blank:]]" /proc/mounts | awk= =20 > '{print $1}') > +current_root_dev=3D${current_root_dev#\/dev/} > +case $current_root_dev in > + mmcblk*) > + ;; > + nvme*) > + ;; > + *) > + current_root_dev=3D${current_root_dev%%[0-9]*} > + ;; > +esac > + > +echo "Searching for target device..." > + > +devices=3D$(find /sys/block/ -type b,c,f,l -not -iname "mmcblk*" -printf= =20 > "%f\n") || true > +mmc_devices=3D$(find /sys/block/ -type b,c,f,l -iname "mmcblk[0-9]" -pri= ntf=20 > "%f\n") || true > +devices=3D"$devices $mmc_devices" > + > +for device in $devices; do > + case $device in > + loop*) > + # skip loop device > + ;; > + sr*) > + # skip CDROM device > + ;; > + ram*) > + # skip ram device > + ;; > + *) > + case $device in > + $current_root_dev*) > + # skip the device we are running from > + ;; > + *) > + target_device_list=3D"$target_device_list $device" > + ;; > + esac > + ;; > + esac > +done > + > +if [ -z "${target_device_list}" ]; then > + dialog --msgbox "You need another device (besides the live device=20 > /dev/${current_root_dev}) to install the image. Installation aborted." 7 = 60 > + exit 1 > +fi > + > +oldIFS=3D${IFS} > +IFS=3D"|" > +set -- "${target_device_list}" > +TARGET_DEVICE=3D$(echo "${1}" | tr -d " ") > +IFS=3D"${oldIFS}" > + > +set -e > +bmap_options=3D"" > +if [ -z "$DISK_BMAP" ]; then > + bmap_options=3D"--nobmap" > +fi > +if ! bmaptool copy "${bmap_options}" "$DISK_IMAGE"=20 > "/dev/${TARGET_DEVICE}" > /install/bmap.log 2>&1; then > + dialog --title "ERROR bmap failed with the following output" --textbox= =20 > /install/bmap.log 24 140 > + exit 1 > +fi > + > +umount /install > +sync > +dialog --title "Reboot" --msgbox "Installation is successful. System wil= l=20 > be rebooted. Please remove the USB stick." 7 60 > +reboot > diff --git=20 > a/meta-isar/recipes-installer/deploy-image/files/install.override.conf=20 > b/meta-isar/recipes-installer/deploy-image/files/install.override.conf > new file mode 100644 > index 00000000..53e9627f > --- /dev/null > +++ b/meta-isar/recipes-installer/deploy-image/files/install.override.con= f > @@ -0,0 +1,5 @@ > +[Service] > +ExecStart=3D > +ExecStart=3D/bin/sh /usr/bin/deploy-image-wic.sh > +StandardInput=3Dtty > +StandardOutput=3Dtty > diff --git a/meta-isar/recipes-installer/store-target-image/ > store-target-image_0.1.bb=20 > b/meta-isar/recipes-installer/store-target-image/store-target-image_0.1.b= b > new file mode 100644 > index 00000000..feb3c6d7 > --- /dev/null > +++ b/meta-isar/recipes-installer/store-target-image/ > store-target-image_0.1.bb > @@ -0,0 +1,19 @@ > +# This software is a part of ISAR. > +# Copyright (C) Siemens AG, 2024 > +# > +# SPDX-License-Identifier: MIT > + > +DESCRIPTION =3D "Add a given target image to rootfs" > + > +inherit dpkg-raw > + > +INSTALLER_TARGET_IMAGE ??=3D "isar-image-base" > +IMG_DATA_FILE ??=3D "${INSTALLER_TARGET_IMAGE}-${DISTRO}-${MACHINE}" > +IMG_DATA_POSTFIX ??=3D "wic.xz" > +do_install[mcdepends] =3D=20 > "mc:installer:installer-target:${INSTALLER_TARGET_IMAGE}:do_image_wic" > +do_install[cleandirs] =3D "${D}/install/" > +do_install() { > + install -m 0600 ${DEPLOY_DIR_IMAGE}/${IMG_DATA_FILE}.${IMG_DATA_POSTFIX= }=20 > ${D}/install/ > + install -m 0600 ${DEPLOY_DIR_IMAGE}/${IMG_DATA_FILE}.wic.bmap=20 > ${D}/install/ > + echo $(du -b ${DEPLOY_DIR_IMAGE}/${IMG_DATA_FILE}.${IMG_DATA_POSTFIX} |= =20 > awk '{print $1}') > ${D}/install/${IMG_DATA_FILE}_size > +} > diff --git a/meta-isar/scripts/lib/wic/canned-wks/installer-efi.wks.in=20 > b/meta-isar/scripts/lib/wic/canned-wks/installer-efi.wks.in > new file mode 100644 > index 00000000..6ff46176 > --- /dev/null > +++ b/meta-isar/scripts/lib/wic/canned-wks/installer-efi.wks.in > @@ -0,0 +1,9 @@ > +# This software is a part of ISAR. > +# Copyright (C) Siemens AG, 2024 > +# > +# SPDX-License-Identifier: MIT > + > +bootloader --ptable gpt --timeout 3 --append "rootwait=20 > console=3DttyS0,115200 console=3Dtty0 earlyprintk" > +part /boot --source bootimg-efi-isar --sourceparams "loader=3Dsystemd-bo= ot"=20 > --label efi --part-type EF00 --align 1024 > +part / --source rootfs --fstype ext4 --label installroot --align 1024=20 > --use-uuid > +part /install --source rootfs --rootfs-dir=3D${IMAGE_ROOTFS}/install=20 > --label INSTALLDATA --fstype=3Dvfat --use-uuid --align 1024 > --=20 > 2.43.0 > > ------=_Part_32825_510951198.1707328848507 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Thanks for sharing this patch!

In the deplo= y-image-wic.sh script there's the following line:

+TARGET_DEVICE=3D$(echo "${1}" | tr -d " ")

=
That will cause the detected drives to merge into one string, e.g. "sd= a sdb" to "sdasdb" and cause installation failure.

<= /div>
Regards,
John



On Tuesday, January 30, 2024 at 1:11:13=E2=80=AFAM UTC-8 Quirin Gylstorff = wrote:
From: = Quirin Gylstorff <quirin.g...= @siemens.com>

This is a example to create installer image which contains another
target image. It uses a multiconfig aproach to seperate the settings
of the installer from the target settings.

Signed-off-by: Quirin Gylstorff <quirin.g...@siemens.com>
---
kas/image/Kconfig | 14 ++++
kas/image/isar-image-installer.yaml | 13 +++
.../conf/multiconfig/installer-target.conf | 6 ++
.../conf/multiconfig/isar-installer.conf | 5 ++
.../images/isar-image-installer.b= b | 17 ++++
.../deploy-image/deploy-image_0.1.bb= | 21 +++++
.../deploy-image/files/deploy-image-wic.sh | 83 +++++++++++++++++++
.../deploy-image/files/install.override.conf | 5 ++
.../store-target-image_0.1.bb= | 19 +++++
.../lib/wic/canned-wks/installer-efi.w= ks.in | 9 ++
10 files changed, 192 insertions(+)
create mode 100644 kas/image/isar-image-installer.yaml
create mode 100644 meta-isar/conf/multiconfig/installer-target.conf
create mode 100644 meta-isar/conf/multiconfig/isar-installer.conf
create mode 100644 meta-isar/recipes-core/images/isar-image-installer.bb
create mode 100644 meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
create mode 100644 meta-isar/recipes-installer/deploy-image/files/depl= oy-image-wic.sh
create mode 100644 meta-isar/recipes-installer/deploy-image/files/inst= all.override.conf
create mode 100644 meta-isar/recipes-installer/store-target-image/store-target-image_0.1.bb
create mode 100644 meta-isar/scripts/lib/wic/canned-wks/installer-efi.wks.in

diff --git a/kas/image/Kconfig b/kas/image/Kconfig
index 8e617386..be6d7019 100644
--- a/kas/image/Kconfig
+++ b/kas/image/Kconfig
@@ -22,11 +22,25 @@ config IMAGE_DEBUG
=09help
=09 This image includes some tools preinstalled useful for debug.
=20
+menuconfig IMAGE_INSTALLER
+=09bool "Installer image"
+=09help
+=09 This image contains a target image and scripts to install that ta= rget image on a device.
+
+config INSTALLER_TARGET_IMAGE
+=09string "Install Base or Debug image"
+=09default "isar-image-base"
+=09help
+=09 This selects the target image of the installer:
+=09 - isar-image-base
+=09 - isar-image-debug
+=09depends on IMAGE_INSTALLER
endchoice
=20
config KAS_INCLUDE_IMAGE
=09string
=09default "kas/image/isar-image-base.yaml" if IMAGE_BASE
=09default "kas/image/isar-image-debug.yaml" if IMAGE_DEBUG
+=09default "kas/image/isar-image-installer.yaml" if IMAGE_IN= STALLER
=20
endmenu
diff --git a/kas/image/isar-image-installer.yaml b/kas/image/isar-image= -installer.yaml
new file mode 100644
index 00000000..f9a3d346
--- /dev/null
+++ b/kas/image/isar-image-installer.yaml
@@ -0,0 +1,13 @@
+# This software is a part of ISAR.
+# Copyright (C) Siemens AG, 2024
+#
+# SPDX-License-Identifier: MIT
+
+header:
+ version: 14
+
+target: isar-image-installer
+
+local_conf_header:
+ installer_multiconfig: |
+ BBMULTICONFIG +=3D "installer-target"
diff --git a/meta-isar/conf/multiconfig/installer-target.conf b/meta-is= ar/conf/multiconfig/installer-target.conf
new file mode 100644
index 00000000..254c91a6
--- /dev/null
+++ b/meta-isar/conf/multiconfig/installer-target.conf
@@ -0,0 +1,6 @@
+# This software is a part of ISAR.
+# Copyright (C) Siemens AG, 2024
+#
+# SPDX-License-Identifier: MIT
+
+IMAGE_FSTYPES +=3D "wic.xz"
diff --git a/meta-isar/conf/multiconfig/isar-installer.conf b/meta-isar= /conf/multiconfig/isar-installer.conf
new file mode 100644
index 00000000..11afcb85
--- /dev/null
+++ b/meta-isar/conf/multiconfig/isar-installer.conf
@@ -0,0 +1,5 @@
+# This software is a part of ISAR.
+# Copyright (C) Siemens AG, 2024
+#
+# SPDX-License-Identifier: MIT
+
diff --git a/meta-isar/recipes-core/images/isar-image-installer.bb b/meta-isar/recipes-core/images/isar-image-installer.bb
new file mode 100644
index 00000000..27de03d5
--- /dev/null
+++ b/meta-isar/recipes-core/images/isar-image-installer.bb
@@ -0,0 +1,17 @@
+# This software is a part of ISAR.
+# Copyright (C) Siemens AG, 2024
+#
+# SPDX-License-Identifier: MIT
+
+inherit image
+DESCRIPTION =3D "Example of a ISAR based Installer Image"
+
+# Use variable to switch easily to another wks
+INSTALLER_WKS_FILE ??=3D "installe= r-efi.wks.in"
+WKS_FILE =3D "${INSTALLER_WKS_FILE}"
+IMAGER_INSTALL:wic:append =3D " systemd-boot"
+
+IMAGE_INSTALL +=3D "store-target-image"
+IMAGE_INSTALL +=3D "deploy-image"
+
+IMAGE_INSTALL:remove =3D "expand-on-first-boot"
diff --git a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb b/meta-isar/recipes-installer/deploy-im= age/deploy-image_0.1.bb
new file mode 100644
index 00000000..9bf25445
--- /dev/null
+++ b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
@@ -0,0 +1,21 @@
+# This software is a part of ISAR.
+# Copyright (C) Siemens AG, 2024
+#
+# SPDX-License-Identifier: MIT
+
+DESCRIPTION =3D "add target image to rootfs"
+
+
+inherit dpkg-raw
+
+SRC_URI =3D "file://deploy-image-wic.sh \
+ file://install.override.conf \
+ "
+DEPENDS =3D "store-target-image"
+DEBIAN_DEPENDS =3D "store-target-image, bmap-tools, pv, dialog, u= til-linux, parted, fdisk, gdisk, pigz, xz-utils, pbzip2"
+do_install[cleandirs] =3D "${D}/usr/bin/ \
+ ${D}/etc/systemd/system/ge...@tty1.service.d/= "
+do_install() {
+ install -m 0755 ${WORKDIR}/deploy-image-wic.sh ${D}/usr/bin/deploy-= image-wic.sh
+ install -m 0755 ${WORKDIR}/install.override.conf ${D}/etc/systemd/sy= stem/ge...@tty1.service.d/override.conf
+}
diff --git a/meta-isar/recipes-installer/deploy-image/files/deploy-imag= e-wic.sh b/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.= sh
new file mode 100644
index 00000000..0d1f4ba8
--- /dev/null
+++ b/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.s= h
@@ -0,0 +1,83 @@
+#!/bin/bash
+# This software is a part of ISAR.
+# Copyright (C) Siemens AG, 2024
+#
+# SPDX-License-Identifier: MIT
+
+DISK_IMAGE=3D$(find /install -type f -iname "*.wic*" -a -not= -iname "*.wic.bmap")
+DISK_BMAP=3D$(find /install -type f -iname "$DISK_IMAGE.bmap"= ;)
+DISK_IMAGE_SIZE=3D$(cat /install/*_size)
+if [ "$DISK_IMAGE_SIZE" -gt "$(( 4096 * 1024 * 1024 ))&= quot; ]; then
+ echo "IMAGE_SIZE: '$DISK_IMAGE_SIZE' is to big for vf= at"
+fi
+
+# inspired by poky/meta/recipes-core/initrdscripts/files/install-efi.s= h
+
+target_device_list=3D""
+current_root_dev=3D$(grep "[[:blank:]]/[[:blank:]]" /proc/mo= unts | awk '{print $1}')
+current_root_dev=3D${current_root_dev#\/dev/}
+case $current_root_dev in
+ mmcblk*)
+ ;;
+ nvme*)
+ ;;
+ *)
+ current_root_dev=3D${current_root_dev%%[0-9]*}
+ ;;
+esac
+
+echo "Searching for target device..."
+
+devices=3D$(find /sys/block/ -type b,c,f,l -not -iname "mmcblk*&q= uot; -printf "%f\n") || true
+mmc_devices=3D$(find /sys/block/ -type b,c,f,l -iname "mmcblk[0-9= ]" -printf "%f\n") || true
+devices=3D"$devices $mmc_devices"
+
+for device in $devices; do
+ case $device in
+ loop*)
+ # skip loop device
+ ;;
+ sr*)
+ # skip CDROM device
+ ;;
+ ram*)
+ # skip ram device
+ ;;
+ *)
+ case $device in
+ $current_root_dev*)
+ # skip the device we are running from
+ ;;
+ *)
+ target_device_list=3D"$target_device_list $de= vice"
+ ;;
+ esac
+ ;;
+ esac
+done
+
+if [ -z "${target_device_list}" ]; then
+ dialog --msgbox "You need another device (besides the live de= vice /dev/${current_root_dev}) to install the image. Installation aborted.&= quot; 7 60
+ exit 1
+fi
+
+oldIFS=3D${IFS}
+IFS=3D"|"
+set -- "${target_device_list}"
+TARGET_DEVICE=3D$(echo "${1}" | tr -d " ")
+IFS=3D"${oldIFS}"
+
+set -e
+bmap_options=3D""
+if [ -z "$DISK_BMAP" ]; then
+ bmap_options=3D"--nobmap"
+fi
+if ! bmaptool copy "${bmap_options}" "$DISK_IMAGE"= "/dev/${TARGET_DEVICE}" > /install/bmap.log 2>&1; then
+ dialog --title "ERROR bmap failed with the following output&q= uot; --textbox /install/bmap.log 24 140
+ exit 1
+fi
+
+umount /install
+sync
+dialog --title "Reboot" --msgbox "Installation is succe= ssful. System will be rebooted. Please remove the USB stick." 7 60
+reboot
diff --git a/meta-isar/recipes-installer/deploy-image/files/install.ove= rride.conf b/meta-isar/recipes-installer/deploy-image/files/install.overrid= e.conf
new file mode 100644
index 00000000..53e9627f
--- /dev/null
+++ b/meta-isar/recipes-installer/deploy-image/files/install.override.c= onf
@@ -0,0 +1,5 @@
+[Service]
+ExecStart=3D
+ExecStart=3D/bin/sh /usr/bin/deploy-image-wic.sh
+StandardInput=3Dtty
+StandardOutput=3Dtty
diff --git a/meta-isar/recipes-installer/store-target-image/store-target-image_0.1.bb b/meta-isar/rec= ipes-installer/store-target-image/store-target-image_0.1.bb
new file mode 100644
index 00000000..feb3c6d7
--- /dev/null
+++ b/meta-isar/recipes-installer/store-target-image/store-target-image_0.1.bb
@@ -0,0 +1,19 @@
+# This software is a part of ISAR.
+# Copyright (C) Siemens AG, 2024
+#
+# SPDX-License-Identifier: MIT
+
+DESCRIPTION =3D "Add a given target image to rootfs"
+
+inherit dpkg-raw
+
+INSTALLER_TARGET_IMAGE ??=3D "isar-image-base"
+IMG_DATA_FILE ??=3D "${INSTALLER_TARGET_IMAGE}-${DISTRO}-${MACHIN= E}"
+IMG_DATA_POSTFIX ??=3D "wic.xz"
+do_install[mcdepends] =3D "mc:installer:installer-target:${INSTAL= LER_TARGET_IMAGE}:do_image_wic"
+do_install[cleandirs] =3D "${D}/install/"
+do_install() {
+ install -m 0600 ${DEPLOY_DIR_IMAGE}/${IMG_DATA_FILE}.${IMG_DATA_POS= TFIX} ${D}/install/
+ install -m 0600 ${DEPLOY_DIR_IMAGE}/${IMG_DATA_FILE}.wic.bmap ${D}/= install/
+ echo $(du -b ${DEPLOY_DIR_IMAGE}/${IMG_DATA_FILE}.${IMG_DATA_POSTFIX= } | awk '{print $1}') > ${D}/install/${IMG_DATA_FILE}_size
+}
diff --git a/meta-isar/scripts/lib/wic/canned-wks/installer-efi.wks.in b/meta-isar/scripts/lib/wic/canned-wks/= installer-efi.wks.in
new file mode 100644
index 00000000..6ff46176
--- /dev/null
+++ b/meta-isar/scripts/lib/wic/canned-wks/installer-efi.wks.in
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) Siemens AG, 2024
+#
+# SPDX-License-Identifier: MIT
+
+bootloader --ptable gpt --timeout 3 --append "rootwait console=3D= ttyS0,115200 console=3Dtty0 earlyprintk"
+part /boot --source bootimg-efi-isar --sourceparams "loader=3Dsys= temd-boot" --label efi --part-type EF00 --align 1024
+part / --source rootfs --fstype ext4 --label installroot --align 1024 = --use-uuid
+part /install --source rootfs --rootfs-dir=3D${IMAGE_ROOTFS}/install -= -label INSTALLDATA --fstype=3Dvfat --use-uuid --align 1024
--=20
2.43.0

------=_Part_32825_510951198.1707328848507-- ------=_Part_32824_1461885065.1707328848507--