diff mbox series

[scarthgap,1/4] arm-systemready/linux-distros: new inc file for unattended installation

Message ID 20240726100109.1878470-1-amr.mohamed@arm.com
State New
Headers show
Series [scarthgap,1/4] arm-systemready/linux-distros: new inc file for unattended installation | expand

Commit Message

amr.mohamed@arm.com July 26, 2024, 10:01 a.m. UTC
From: Amr Mohamed <amr.mohamed@arm.com>

Add a new inc file to unpack and repack the distro ISO image after
adding the kickstart configuration file inside.

Signed-off-by: Amr Mohamed <amr.mohamed@arm.com>
---
 ...m-systemready-linux-distros-unattended.inc | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-unattended.inc

Comments

Jon Mason July 31, 2024, 3:23 a.m. UTC | #1
On Fri, Jul 26, 2024 at 11:01:06AM +0100, amr.mohamed@arm.com wrote:
> From: Amr Mohamed <amr.mohamed@arm.com>
> 
> Add a new inc file to unpack and repack the distro ISO image after
> adding the kickstart configuration file inside.
 
This series isn't applying to scarthgap for me.  I tried:
b4 shazam -s 20240726100109.1878470-1-amr.mohamed@arm.com

But I get an error of:
Applying: arm-systemready/linux-distros: Add kickstart file for Fedora unattended
Patch failed at 0002 arm-systemready/linux-distros: Add kickstart file for Fedora unattended
...
error: patch failed: meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros.inc:2
error: meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros.inc: patch does not apply

I'm not seeing this issue with the other series.  So, I don't believe
it's related to email garbling the patch.  I'll follow-up tomorrow
with you.

Thanks,
Jon


> Signed-off-by: Amr Mohamed <amr.mohamed@arm.com>
> ---
>  ...m-systemready-linux-distros-unattended.inc | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-unattended.inc
> 
> diff --git a/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-unattended.inc b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-unattended.inc
> new file mode 100644
> index 00000000..f8c9c6c5
> --- /dev/null
> +++ b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-unattended.inc
> @@ -0,0 +1,45 @@
> +SUMMARY = "Arm SystemReady Linux distros unattended requirements"
> +DESCRIPTION = "Arm SystemReady Linux distro unattended configurations \
> +               and ISO image modification"
> +
> +EXTRACTED_ISO_TEMP_DIR = "${WORKDIR}/extracted_iso_temp_dir"
> +NEW_ISO_TEMP_DIR = "${WORKDIR}/new_iso_temp_dir"
> +
> +# oeqa test case must be added to TEST_SUITES to acknowledge that the unattended
> +# installation was successful.
> +inherit testimage
> +
> +python () {
> +    unattended_required_vars = ['ISO_LABEL', 'BOOT_CATALOG', 'BOOT_IMAGE', 'EFI_IMAGE']
> +
> +    for var in unattended_required_vars:
> +        if not d.getVar(var):
> +            raise bb.parse.SkipRecipe(f'{var} variable is not set')
> +}
> +
> +unpackiso() {
> +    # Unpack the ISO image
> +    bsdtar -xf ${WORKDIR}/${ISO_IMAGE_NAME}.iso -C ${EXTRACTED_ISO_TEMP_DIR}
> +    chmod -R u+rw ${EXTRACTED_ISO_TEMP_DIR}
> +}
> +
> +modifyiso() {
> +
> +}
> +
> +repackiso() {
> +    # Repack the ISO image
> +    mkisofs -o ${NEW_ISO_TEMP_DIR}/${ISO_IMAGE_NAME}.iso -U -r -v -T -J -joliet-long -V ${ISO_LABEL} \
> +            -volset ${ISO_LABEL} -A ${ISO_LABEL} -b ${BOOT_IMAGE} -c ${BOOT_CATALOG} -no-emul-boot \
> +            -boot-load-size 4 -boot-info-table -J -R -V ${ISO_LABEL} -eltorito-alt-boot \
> +            -eltorito-boot ${EFI_IMAGE} -no-emul-boot ${EXTRACTED_ISO_TEMP_DIR}
> +
> +    mv -f ${NEW_ISO_TEMP_DIR}/${ISO_IMAGE_NAME}.iso ${WORKDIR}
> +}
> +
> +# Write the test data in IMAGE_POSTPROCESS_COMMAND
> +IMAGE_POSTPROCESS_COMMAND += "write_image_test_data; "
> +
> +do_unpack[depends] += "cdrtools-native:do_populate_sysroot libarchive-native:do_populate_sysroot"
> +do_unpack[postfuncs] += "unpackiso modifyiso repackiso"
> +do_unpack[cleandirs] += "${EXTRACTED_ISO_TEMP_DIR} ${NEW_ISO_TEMP_DIR}"
> \ No newline at end of file
> -- 
> 2.25.1
> 
>
diff mbox series

Patch

diff --git a/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-unattended.inc b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-unattended.inc
new file mode 100644
index 00000000..f8c9c6c5
--- /dev/null
+++ b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-unattended.inc
@@ -0,0 +1,45 @@ 
+SUMMARY = "Arm SystemReady Linux distros unattended requirements"
+DESCRIPTION = "Arm SystemReady Linux distro unattended configurations \
+               and ISO image modification"
+
+EXTRACTED_ISO_TEMP_DIR = "${WORKDIR}/extracted_iso_temp_dir"
+NEW_ISO_TEMP_DIR = "${WORKDIR}/new_iso_temp_dir"
+
+# oeqa test case must be added to TEST_SUITES to acknowledge that the unattended
+# installation was successful.
+inherit testimage
+
+python () {
+    unattended_required_vars = ['ISO_LABEL', 'BOOT_CATALOG', 'BOOT_IMAGE', 'EFI_IMAGE']
+
+    for var in unattended_required_vars:
+        if not d.getVar(var):
+            raise bb.parse.SkipRecipe(f'{var} variable is not set')
+}
+
+unpackiso() {
+    # Unpack the ISO image
+    bsdtar -xf ${WORKDIR}/${ISO_IMAGE_NAME}.iso -C ${EXTRACTED_ISO_TEMP_DIR}
+    chmod -R u+rw ${EXTRACTED_ISO_TEMP_DIR}
+}
+
+modifyiso() {
+
+}
+
+repackiso() {
+    # Repack the ISO image
+    mkisofs -o ${NEW_ISO_TEMP_DIR}/${ISO_IMAGE_NAME}.iso -U -r -v -T -J -joliet-long -V ${ISO_LABEL} \
+            -volset ${ISO_LABEL} -A ${ISO_LABEL} -b ${BOOT_IMAGE} -c ${BOOT_CATALOG} -no-emul-boot \
+            -boot-load-size 4 -boot-info-table -J -R -V ${ISO_LABEL} -eltorito-alt-boot \
+            -eltorito-boot ${EFI_IMAGE} -no-emul-boot ${EXTRACTED_ISO_TEMP_DIR}
+
+    mv -f ${NEW_ISO_TEMP_DIR}/${ISO_IMAGE_NAME}.iso ${WORKDIR}
+}
+
+# Write the test data in IMAGE_POSTPROCESS_COMMAND
+IMAGE_POSTPROCESS_COMMAND += "write_image_test_data; "
+
+do_unpack[depends] += "cdrtools-native:do_populate_sysroot libarchive-native:do_populate_sysroot"
+do_unpack[postfuncs] += "unpackiso modifyiso repackiso"
+do_unpack[cleandirs] += "${EXTRACTED_ISO_TEMP_DIR} ${NEW_ISO_TEMP_DIR}"
\ No newline at end of file