From patchwork Wed Jul 31 14:39:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: amr.mohamed@arm.com X-Patchwork-Id: 47059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 514A6C52D1D for ; Wed, 31 Jul 2024 14:39:59 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.44370.1722436796802029302 for ; Wed, 31 Jul 2024 07:39:56 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: amr.mohamed@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 23E741063; Wed, 31 Jul 2024 07:40:22 -0700 (PDT) Received: from e125330.manchester.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 93B0A3F5A1; Wed, 31 Jul 2024 07:39:55 -0700 (PDT) From: amr.mohamed@arm.com To: meta-arm@lists.yoctoproject.org Cc: Amr Mohamed , Jon Mason Subject: [PATCH scarthgap 2/4] arm-systemready/linux-distros: Add kickstart file for Fedora unattended Date: Wed, 31 Jul 2024 15:39:45 +0100 Message-Id: <20240731143947.2502491-2-amr.mohamed@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240731143947.2502491-1-amr.mohamed@arm.com> References: <20240731143947.2502491-1-amr.mohamed@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 31 Jul 2024 14:39:59 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/5937 From: Amr Mohamed Add the Fedora kickstart configuration file and define a function to modify the unpacked ISO image to add the kickstart file inside and modify the grub.cfg file. Signed-off-by: Amr Mohamed Signed-off-by: Jon Mason --- .../arm-systemready-linux-distros-fedora.bb | 16 ++++++++ .../arm-systemready-linux-distros.inc | 15 ++++++- .../unattended-boot-conf/Fedora/ks.cfg | 39 +++++++++++++++++++ 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 meta-arm-systemready/recipes-test/arm-systemready-linux-distros/unattended-boot-conf/Fedora/ks.cfg diff --git a/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-fedora.bb b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-fedora.bb index 25990b30..de4ea36d 100644 --- a/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-fedora.bb +++ b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-fedora.bb @@ -98,6 +98,22 @@ file://${COMMON_LICENSE_DIR}/OPUBL-1.0;md5=99367d4750dbf0ae6cc74209ddd52f6d \ ARM_SYSTEMREADY_LINUX_DISTRO_INSTALL_SIZE = "6144" +TEST_SUITES = "${@oe.utils.vartrue("DISTRO_UNATTENDED_INST_TESTS", "arm_systemready_fedora_unattended", "", d)}" + +ISO_LABEL = "${@oe.utils.vartrue("DISTRO_UNATTENDED_INST_TESTS", "Fedora-S-dvd-aarch64-39", "", d)}" +BOOT_CATALOG = "${@oe.utils.vartrue("DISTRO_UNATTENDED_INST_TESTS", "boot.catalog", "", d)}" +BOOT_IMAGE = "${@oe.utils.vartrue("DISTRO_UNATTENDED_INST_TESTS", "EFI/BOOT/BOOTAA64.EFI", "", d)}" +EFI_IMAGE = "${@oe.utils.vartrue("DISTRO_UNATTENDED_INST_TESTS", "images/efiboot.img", "", d)}" + PV = "39.1.5" SRC_URI = "https://download.fedoraproject.org/pub/fedora/linux/releases/39/Server/aarch64/iso/Fedora-Server-dvd-aarch64-39-1.5.iso;unpack=0;downloadfilename=${ISO_IMAGE_NAME}.iso" SRC_URI[sha256sum] = "d19dc2a39758155fa53e6fd555d0d173ccc8175b55dea48002d499f39cb30ce0" + +modifyiso() { + UNATTENDED_CONF_DIR="${THISDIR}/unattended-boot-conf/Fedora" + + cp "${UNATTENDED_CONF_DIR}/ks.cfg" ${EXTRACTED_ISO_TEMP_DIR} + sed -i 's/set default="1"/set default="0"/g' "${EXTRACTED_ISO_TEMP_DIR}/EFI/BOOT/grub.cfg" + sed -i 's/set timeout=60/set timeout=0/g' "${EXTRACTED_ISO_TEMP_DIR}/EFI/BOOT/grub.cfg" + sed -i '0,/vmlinuz/s/vmlinuz/& inst.ks=hd:LABEL=Fedora-S-dvd-aarch64-39:\/ks.cfg/' "${EXTRACTED_ISO_TEMP_DIR}/EFI/BOOT/grub.cfg" +} diff --git a/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros.inc b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros.inc index d80cf237..e04d7d46 100644 --- a/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros.inc +++ b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros.inc @@ -2,7 +2,12 @@ SUMMARY = "Arm SystemReady Linux distros installation" DESCRIPTION = "Arm SystemReady Linux distro CD/DVD images and installation \ target disk image" -IMAGE_CLASSES:remove = "license_image testimage" +DISTRO_UNATTENDED_INST_TESTS ?= "0" + +require ${@oe.utils.vartrue("DISTRO_UNATTENDED_INST_TESTS", "arm-systemready-linux-distros-unattended.inc", "", d)} + +IMAGE_CLASSES:remove = "license_image" +IMAGE_CLASSES:remove = "${@oe.utils.vartrue("DISTRO_UNATTENDED_INST_TESTS", "", "testimage", d)}" BUILDHISTORY_FEATURES:remove = "image" INHIBIT_DEFAULT_DEPS = "1" @@ -15,7 +20,7 @@ do_configure[noexec] = "1" do_compile[noexec] = "1" ISO_IMAGE_NAME = "${PN}-${PV}" -IMAGE_LINK_NAME = "${PN}-${PV}-${MACHINE}" +IMAGE_LINK_NAME = "${PN}-${MACHINE}" ARM_SYSTEMREADY_LINUX_DISTRO_ISO_IMAGE = \ "${DEPLOY_DIR_IMAGE}/${ISO_IMAGE_NAME}.iso" @@ -44,7 +49,13 @@ python do_image_complete() { from oe.utils import execute_pre_post_process post_process_cmds = d.getVar("IMAGE_POSTPROCESS_COMMAND") execute_pre_post_process(d, post_process_cmds) + + if d.getVar('DISTRO_UNATTENDED_INST_TESTS') == "1": + # Ensure an empty rootfs manifest exists (required by testimage) + fname = os.path.join(d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_LINK_NAME') + ".manifest") + open(fname, 'w').close() } + do_image_complete[nostamp] = "1" addtask image_complete after do_deploy before do_build diff --git a/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/unattended-boot-conf/Fedora/ks.cfg b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/unattended-boot-conf/Fedora/ks.cfg new file mode 100644 index 00000000..f8ea3bc6 --- /dev/null +++ b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/unattended-boot-conf/Fedora/ks.cfg @@ -0,0 +1,39 @@ +# Generated by Anaconda 39.32.6 +# Generated by pykickstart v3.48 +#version=DEVEL +# Use text mode install +text + +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_GB.UTF-8 + +# Use CDROM installation media +cdrom + +%packages --excludedocs --ignoremissing +@core --nodefaults + +%end + +# Run the Setup Agent on first boot +firstboot --enable +# Do not configure the X Window System +skipx + +# System bootloader configuration +bootloader --location=mbr --boot-drive=vda +autopart +# Partition clearing information +clearpart --all --initlabel --drives=vda + +# System timezone +timezone Europe/London --utc + +# Root password +rootpw --lock +user --groups=wheel --name=user --password=unsafe --gecos="usr1" + +# Reboot after installation with an attempt to eject the installation media +reboot --eject