From patchwork Thu Nov 14 13:55:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Mikanovich X-Patchwork-Id: 3927 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 14 Nov 2024 14:55:23 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f64.google.com (mail-lf1-f64.google.com [209.85.167.64]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AEDtMum002205 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Nov 2024 14:55:22 +0100 Received: by mail-lf1-f64.google.com with SMTP id 2adb3069b0e04-53da203141bsf551910e87.1 for ; Thu, 14 Nov 2024 05:55:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731592517; cv=pass; d=google.com; s=arc-20240605; b=MRcOzaLv6nuVlEYCupKu6qdaUE0ntexkwy45AXu+OtTwVY5nKoyejeOGhhKtUOS/Kq I8xGbU0sJ5I1T8sQHzd3n2JFzDw8jq8EpXz096Xt1XnX8AUf09n3tzml9+ziSI/AhKub DIm0rYHWWP7EW+r7WTOBZBz4rRNiag9O74fRryWxX1NAa9Ho5tnvcQib09Ka9zloDIw5 xfugm+Q/xVAxJZ6WdSkIAQ6l6nrou0YvPx//+AERBKPupCXNoZgXR9ETB+sZ2lIrjbzV veCEkFdENQ4Xm98u3vOax11RwAsc9PDBlW5cZSscpjIa3XmCjdxEdL74rdLIDn0YJUWe wNmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=s32HtBUqNFAxvMbe9kaPDeneeoGyhuFVC0zVGoLPt4s=; fh=bS+GlSLa0d7Mil83rbMBkCJdROVGbfFm5leIlE7MUvI=; b=BJNAYmpkv/Ei7AfaPHCKOm9MXYGv3YWCAYph86gVXig0NVmYttkduspBSuwsp2hiIQ 6D+1WVqS+wPbhyshYtupbVzvixdouUAn8WmQ/hlnb4ZdiRN10l9Wzb5CkheTNBMqZ0fP ZlAoPs1aNc7kGRu4lGk75JaqyXdfkHNF7ATNVbJKM/2Tm6awm0X+ttTYMQ/Ct+s56qOS SeYt17sR+mjfYfRjuudo52PiGdvXdVAMYijtkbY+ApnPf8XHqUoGBJN9t7B1qRTv3DHm letOZN0rrPSpk/gxiImw3IyqPWU+rMaJXqzwlfdIFJwS9dDLskNOz/adwo+4mkbjSw2d sRMg==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1731592517; x=1732197317; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=s32HtBUqNFAxvMbe9kaPDeneeoGyhuFVC0zVGoLPt4s=; b=CAS9oeolGIfUfuU5MfxO1dfDU3LC9lNGUjOhlTjL/CMoP5C/97E2SpE1QKjwFx8SEv PpwzhWZWl50bJFmBvnYoPySBGMLqSv8rFHtSOwzerWEOmqvSh8R+8M5e550eeS49dSAP dBoOO93HNx218WUMltx4gaPRcwppghDaHyXQQ53tSJj8NuVyHBIpIQ+UyUmzPL6xLYnD mi7Ytv2ygpkYAdaS+WnlKfmlIdepyxGpw9kWYkupuSPuP3/ZUsnS8C/2raHrnx0OhadF UNJBdSp/9UV7hg6onErqEdjvnEx9Pdjl7A/xzQyNYYTIa/0j4qbsRMnfk5b/BkmTVp2C lyLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731592517; x=1732197317; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=s32HtBUqNFAxvMbe9kaPDeneeoGyhuFVC0zVGoLPt4s=; b=rdMseEEjuja+ruMr9XdwF6NV4Z7EJs4FNnf4lM9DJrF2ZaXZZJ2QKwpWoWkKGGvMyM IeFoYAQOH9RoVVU0WduZOeEeQZD3ucQteRhGCHYkiy5CblrUYRGkgadmO1MOlw/MBxEn FNo/NBG/R7/MYKV8U0a6glXhFWyeci2IBIJJhudEpQq7WU5rUDGyBKT6X8w3gYvwzyM2 r4jyb4A+KOBEHh8DWcq9JLzUX38K7anJu+NxR9Pun3m53fZRVawDHCWGLNoYKrrl3GQw UuVMXQxVs8Gkdw6zTvD8omQEyIDXW/lOI3sHP0T/8DGSJcnNYcWfVu2O9JQ4hTC267GJ 0jpw== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCU3Vp1kHQjuu4+UpZYVf6FBElk0KpOQ/J7E3t7r6zwt3BTuBDik7g3cowex6ANaDKUMrT7eIdg=@isar-build.org X-Gm-Message-State: AOJu0YyFmEtJ2vRUIQ9hAwjDjbnyRO2hilYArNSt6mI6iNCiFBLRA6ld MSunl+yEAd4GHDKeXiuBc4EgdWbHTHhERnuKitr5S3T2hUh7ZnCJ X-Google-Smtp-Source: AGHT+IEAN54keGw50bmvcD7c/eDm/uTkFBWznLysAmHgzbLtDZvYb8MUEIy5ECDdY7a0F2vLUufRNw== X-Received: by 2002:a05:6512:2807:b0:53d:a822:9ce7 with SMTP id 2adb3069b0e04-53da8229d17mr1109154e87.31.1731592516215; Thu, 14 Nov 2024 05:55:16 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:3ba1:b0:53c:5873:6328 with SMTP id 2adb3069b0e04-53da4d149cfls33683e87.1.-pod-prod-09-eu; Thu, 14 Nov 2024 05:55:14 -0800 (PST) X-Received: by 2002:a05:6512:1288:b0:539:e873:6e2 with SMTP id 2adb3069b0e04-53d862bd450mr12254455e87.8.1731592514040; Thu, 14 Nov 2024 05:55:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731592514; cv=none; d=google.com; s=arc-20240605; b=dKLFOWj4tfpT/PvsFxLAfNhZTflB/XwTnr7Y7dEazhg32mWgeOEI5yGZo+cHHwzfNX yupihYhPujbC/oGRspsD9LFR0pehIjgoeUc1W4+JcoqMeXWQwHjZ39ZLobhrtEHKFdyN gdIMcFpULTUelMjrgkDqyKIt1uIfXw0myCvGKDA1Cw4/N7JCrskj3FhH0AgimGUpSp8g qHG9Cycitfu34dWYIcop5W4P0Gk81s8WFO49r8NNj1LOlsX+pOVlkCic05apP8mIcPMc O8Aj/2qHc58rZkaQsWjxm/A6uDSXF7KQdTd+JoEZ3wDQ4bXlp9RnqjgglA12o0qBB9kU 8OQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=gx4I3AS68Z58PNODK25Sn2Q9tufbpbKfhlry9zfptUw=; fh=/h9QQkzJ8EboVkWg45aWwpaUro6WMavIVd2OhN45RtE=; b=KJXOP5PObInPv57mm78ONhb8bsackMXeRc0pOkvCyzNImoOysXEoTek0SUAiW7gMRp iIMhiWjo1irkdPtp7HSXMDrMEWKvhIKnKj5qh8FFOaKqaYyWFm84Ag7TIEdBA03zBIA/ W2vC89LQYQUX8A+hMj8KOq7ge8I/IrbvDptw385HSTdmTHyEm8mK2cJwy4hc27ryp5vk owpSazZKZ/ZNg/uNtMIqRw9qQsL++D3NEzxo8RmWnySYyFLM245pymS0YkXTDnevjVxT tO9i64txBg9OhHob5ikzYZNNEUulxugs2vUcTV4uZdUvV1FKgyKry2Pv23kx4KlY9tht wP3g==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 2adb3069b0e04-53da654a820si47316e87.12.2024.11.14.05.55.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Nov 2024 05:55:13 -0800 (PST) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from user-B660.promwad.corp ([159.148.83.114]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 4AEDtCpk002198 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Nov 2024 14:55:12 +0100 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH] wic: Allow custom kernel image names Date: Thu, 14 Nov 2024 15:55:06 +0200 Message-Id: <20241114135506.1467238-1-amikan@ilbers.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-Original-Sender: amikan@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Some targets can have custom kernel file names specified with KERNEL_FILE variable. Take this value into account when trying to autodetect boot files inside WIC plugins. Signed-off-by: Anton Mikanovich --- meta/classes/imagetypes_wic.bbclass | 2 +- meta/scripts/lib/wic/plugins/isarpluginbase.py | 8 ++++++-- meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py | 8 ++++++-- .../scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py | 4 +++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/meta/classes/imagetypes_wic.bbclass b/meta/classes/imagetypes_wic.bbclass index 3b697cdd..38b5f0e1 100644 --- a/meta/classes/imagetypes_wic.bbclass +++ b/meta/classes/imagetypes_wic.bbclass @@ -107,7 +107,7 @@ WICVARS += "\ ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR TARGET_SYS TRANSLATED_TARGET_ARCH" # Isar specific vars used in our plugins -WICVARS += "DISTRO DISTRO_ARCH" +WICVARS += "DISTRO DISTRO_ARCH KERNEL_FILE" python do_rootfs_wicenv () { wicvars = d.getVar('WICVARS') diff --git a/meta/scripts/lib/wic/plugins/isarpluginbase.py b/meta/scripts/lib/wic/plugins/isarpluginbase.py index 99e552e0..76df733d 100644 --- a/meta/scripts/lib/wic/plugins/isarpluginbase.py +++ b/meta/scripts/lib/wic/plugins/isarpluginbase.py @@ -15,9 +15,13 @@ def isar_populate_boot_cmd(rootfs_dir, hdddir): # no not copy symlinks (ubuntu places them here) because targetfs is fat return "find %s/boot -type f -exec cp -a {} %s ;" % (rootfs_dir, hdddir) -def isar_get_filenames(rootfs_dir): + +def isar_get_filenames(rootfs_dir, kernel_file=None): # figure out the real filename in /boot by following debian symlinks - for kernel_symlink in ["vmlinuz", "vmlinux" ]: + possible_kernel_files = ["vmlinuz", "vmlinux"] + if kernel_file: + possible_kernel_files.insert(0, kernel_file) + for kernel_symlink in possible_kernel_files: kernel_file_abs = os.path.join(rootfs_dir, kernel_symlink) if os.path.isfile(kernel_file_abs): break diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py index 079b70d6..50f4187d 100644 --- a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py +++ b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py @@ -108,7 +108,9 @@ class BootimgEFIPlugin(SourcePlugin): if label: label_conf = "LABEL=%s" % label - kernel, initrd = isar_get_filenames(get_bitbake_var("IMAGE_ROOTFS")) + kernel, initrd = isar_get_filenames( + get_bitbake_var("IMAGE_ROOTFS"), get_bitbake_var("KERNEL_FILE") + ) grubefi_conf += "linux /%s %s rootwait %s\n" \ % (kernel, label_conf, bootloader.append) @@ -186,7 +188,9 @@ class BootimgEFIPlugin(SourcePlugin): title = source_params.get('title') temp_initrd = initrd - kernel, initrd = isar_get_filenames(get_bitbake_var("IMAGE_ROOTFS")) + kernel, initrd = isar_get_filenames( + get_bitbake_var("IMAGE_ROOTFS"), get_bitbake_var("KERNEL_FILE") + ) if temp_initrd: initrd = temp_initrd diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py index 43f4bec4..d5040b72 100644 --- a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py +++ b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py @@ -134,7 +134,9 @@ class BootimgPcbiosIsarPlugin(SourcePlugin): kernel = "/vmlinuz" - kernel, initrd = isar_get_filenames(get_bitbake_var("IMAGE_ROOTFS")) + kernel, initrd = isar_get_filenames( + get_bitbake_var("IMAGE_ROOTFS"), get_bitbake_var("KERNEL_FILE") + ) syslinux_conf += "KERNEL " + kernel + "\n"