From patchwork Thu May 2 11:16:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 13651631 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE028C4345F for ; Thu, 2 May 2024 11:16:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QPU8gs1V66+c2w056hNaMDzB8Z90cy0D4qTmVBi6q0A=; b=o+C9wyWw37VnKU YK96csXcjCxuz2u/oIpDvMgHBj7qpJrurd3pbGIv3Rroo0nG4Z0w7YpyjlUHZ/AllJyRiCMUibVE0 nSEmn5owVvd98XZmm8VhW+bWgWmJPKYK0Qv3b49IBIaqytrkUic5kqZS54xpNYJ6P493yPGhjEAvb RVeOhfc7oST+WGfF7cSPowAoE4S6NP2+TvgbcohI+pJurTS4Qw974M+rQ8lBam8UO6B2kDZAfJWCS b1Y2IAUqA2+iv4tphK4+i0U8mLmZfsXR1M49XI7XI3htwAgarcDyoHGYxFh9bbkfqFXORLiqf87+j JSr+QzOmtqqa8T+pFLEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2UQQ-0000000CUI2-0imY; Thu, 02 May 2024 11:16:30 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2UQN-0000000CUFS-0Uym for linux-riscv@lists.infradead.org; Thu, 02 May 2024 11:16:28 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id B10993FE63 for ; Thu, 2 May 2024 11:16:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1714648582; bh=MK9pS8zh0OAd8/YKYBCNbvjlHmkQLgxQ6JtcNKhjMOU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fKx7hk+UP9wGhEJgc+atiCRs7VgqD6FAHc/fv84q906/2uvB4SbdXpSK+RzgTvT51 ewdZg5HwPENzu9rAxG3cvC+20HJ/zr6KreI64U62lPHKzA+JSB3DQPlACbQerVe39n uu8in9WvBW2gvTcaayYcyPnCoR2COMVYoWCLxhIIp9OaMoQk+0rDHhPTLp32rVgVTQ wocEYaKZXa2VnDzg+tNJekvnJezWcjMqYJB9AKB488Ffqz9SRv6HPZdncLIkDSuUA6 Fo9tPNd3y7bB17M4j0HKqNMyrxredb5d6L9nmGFGKafsyZRv2ZF+h+kmQ0fLj0a5B2 FH5wZN5fktWTg== Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a524b774e39so165081766b.1 for ; Thu, 02 May 2024 04:16:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714648577; x=1715253377; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MK9pS8zh0OAd8/YKYBCNbvjlHmkQLgxQ6JtcNKhjMOU=; b=afU1YbxnDCRGIbPTx9cGMlR8olYxhG5BD/C/nhY4uFiB47usBhNYNT4pgE9cN5kmyE F2S2jN4/lRBW6Xs7OFul1ZhR9LpbAxlrC/HVFMaFa094oNl2tYl2w49msgNUhSe/sbP0 oFE0Bl+Itco3Jdqgs3K5/KHdgaABk3dLi3SpdPWMC3y8Cq0UQYLY80vcYJ72z9lkKZKb B2EyT4Is9/4c9zzClxAPrzQU4ThKPcrVFAxcu3gHuw/SX6AOYFb+xO3WwVyTMrXnCcH1 DXNCHKbJpogWgKrLmDPYtaRTqVd5t6M0dZxGzaDSXy3Aj5E9pqRjx2071W5kyAbrJ677 S00w== X-Gm-Message-State: AOJu0YxgW5GWGXGRPwNo7vFKXgGkuSW3fdXwKfK4RohldhzX1NiwWUd/ s3pI2S60o8heaaXKL6qQSoucaWnLLAhaUu43ii51vZ8wJtvdFdf0BGLT8H3gGNdLL8AtksUdWfQ O+MzKWtvYj3Um0K4lI48I8dj0lXJLlYq2bsdQvMN0dmDIUUyn7hPFhJW+qsmArDpZiw4dFB+ZS0 /2em4zyn5V5joTGA== X-Received: by 2002:a17:906:248b:b0:a58:eb0d:f2a6 with SMTP id e11-20020a170906248b00b00a58eb0df2a6mr1882987ejb.31.1714648576859; Thu, 02 May 2024 04:16:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7LnYqMf09AgSTE93ChylTc81npf1nJHpjVmGmIFbInD5oUeTRsn+ecAVqhExu0Tv8wF6tLQ== X-Received: by 2002:a17:906:248b:b0:a58:eb0d:f2a6 with SMTP id e11-20020a170906248b00b00a58eb0df2a6mr1882976ejb.31.1714648576542; Thu, 02 May 2024 04:16:16 -0700 (PDT) Received: from stitch.. ([80.71.142.166]) by smtp.gmail.com with ESMTPSA id gs23-20020a170906f19700b00a4739efd7cesm437278ejb.60.2024.05.02.04.16.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 04:16:15 -0700 (PDT) From: Emil Renner Berthing To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Paul Walmsley , Palmer Dabbelt , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Nick Terrell Subject: [PATCH v1 1/3] riscv: make image compression configurable Date: Thu, 2 May 2024 13:16:06 +0200 Message-ID: <20240502111613.1380453-2-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240502111613.1380453-1-emil.renner.berthing@canonical.com> References: <20240502111613.1380453-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240502_041627_315996_73657ADB X-CRM114-Status: GOOD ( 13.37 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Previously the build process would always set KBUILD_IMAGE to the uncompressed Image file (unless XIP_KERNEL or EFI_ZBOOT was enabled) and unconditionally compress it into Image.gz. However there are already build targets for Image.bz2, Image.lz4, Image.lzma, Image.lzo and Image.zstd, so let's make use of those, make the compression method configurable and set KBUILD_IMAGE accordingly so that targets like 'make install' and 'make bindeb-pkg' will use the chosen image. Signed-off-by: Emil Renner Berthing --- arch/riscv/Kconfig | 7 +++++++ arch/riscv/Makefile | 43 ++++++++++++++++++++------------------ arch/riscv/boot/install.sh | 9 +++++--- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index be09c8836d56..6c092d1ea7db 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -138,6 +138,13 @@ config RISCV select HAVE_GCC_PLUGINS select HAVE_GENERIC_VDSO if MMU && 64BIT select HAVE_IRQ_TIME_ACCOUNTING + select HAVE_KERNEL_BZIP2 if !XIP_KERNEL && !EFI_ZBOOT + select HAVE_KERNEL_GZIP if !XIP_KERNEL && !EFI_ZBOOT + select HAVE_KERNEL_LZ4 if !XIP_KERNEL && !EFI_ZBOOT + select HAVE_KERNEL_LZMA if !XIP_KERNEL && !EFI_ZBOOT + select HAVE_KERNEL_LZO if !XIP_KERNEL && !EFI_ZBOOT + select HAVE_KERNEL_UNCOMPRESSED if !XIP_KERNEL && !EFI_ZBOOT + select HAVE_KERNEL_ZSTD if !XIP_KERNEL && !EFI_ZBOOT select HAVE_KPROBES if !XIP_KERNEL select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL select HAVE_KRETPROBES if !XIP_KERNEL diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 5b3115a19852..29be676415d6 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -129,11 +129,27 @@ endif CHECKFLAGS += -D__riscv -D__riscv_xlen=$(BITS) # Default target when executing plain make -boot := arch/riscv/boot +boot := arch/riscv/boot ifeq ($(CONFIG_XIP_KERNEL),y) KBUILD_IMAGE := $(boot)/xipImage +else ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_ARCH_CANAAN),yy) +KBUILD_IMAGE := $(boot)/loader.bin +else ifeq ($(CONFIG_EFI_ZBOOT),y) +KBUILD_IMAGE := $(boot)/vmlinuz.efi +else ifeq ($(CONFIG_KERNEL_GZIP),y) +KBUILD_IMAGE := $(boot)/Image.gz +else ifeq ($(CONFIG_KERNEL_BZIP2),y) +KBUILD_IMAGE := $(boot)/Image.bz2 +else ifeq ($(CONFIG_KERNEL_LZ4),y) +KBUILD_IMAGE := $(boot)/Image.lz4 +else ifeq ($(CONFIG_KERNEL_LZMA),y) +KBUILD_IMAGE := $(boot)/Image.lzma +else ifeq ($(CONFIG_KERNEL_LZO),y) +KBUILD_IMAGE := $(boot)/Image.lzo +else ifeq ($(CONFIG_KERNEL_ZSTD),y) +KBUILD_IMAGE := $(boot)/Image.zst else -KBUILD_IMAGE := $(boot)/Image.gz +KBUILD_IMAGE := $(boot)/Image endif libs-y += arch/riscv/lib/ @@ -153,32 +169,19 @@ endif vdso-install-y += arch/riscv/kernel/vdso/vdso.so.dbg vdso-install-$(CONFIG_COMPAT) += arch/riscv/kernel/compat_vdso/compat_vdso.so.dbg -ifneq ($(CONFIG_XIP_KERNEL),y) -ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_ARCH_CANAAN),yy) -KBUILD_IMAGE := $(boot)/loader.bin -else -ifeq ($(CONFIG_EFI_ZBOOT),) -KBUILD_IMAGE := $(boot)/Image.gz -else -KBUILD_IMAGE := $(boot)/vmlinuz.efi -endif -endif -endif -BOOT_TARGETS := Image Image.gz loader loader.bin xipImage vmlinuz.efi +BOOT_TARGETS := Image Image.gz Image.bz2 Image.lz4 Image.lzma Image.lzo Image.zst loader loader.bin xipImage vmlinuz.efi all: $(notdir $(KBUILD_IMAGE)) loader.bin: loader -Image.gz loader vmlinuz.efi: Image +Image.gz Image.bz2 Image.lz4 Image.lzma Image.lzo Image.zst loader xipImage vmlinuz.efi: Image + $(BOOT_TARGETS): vmlinux $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ @$(kecho) ' Kernel: $(boot)/$@ is ready' -Image.%: Image - $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ - -install: KBUILD_IMAGE := $(boot)/Image -zinstall: KBUILD_IMAGE := $(boot)/Image.gz +# the install target always installs KBUILD_IMAGE (which may be compressed) +# but keep the zinstall target for compatibility with older releases install zinstall: $(call cmd,install) diff --git a/arch/riscv/boot/install.sh b/arch/riscv/boot/install.sh index 4c63f3f0643d..a8df7591513a 100755 --- a/arch/riscv/boot/install.sh +++ b/arch/riscv/boot/install.sh @@ -17,15 +17,18 @@ # $3 - kernel map file # $4 - default install path (blank if root directory) -if [ "$(basename $2)" = "Image.gz" ]; then +case "${2##*/}" in # Compressed install +Image.*|vmlinuz.efi) echo "Installing compressed kernel" base=vmlinuz -else + ;; # Normal install +*) echo "Installing normal kernel" base=vmlinux -fi + ;; +esac if [ -f $4/$base-$1 ]; then mv $4/$base-$1 $4/$base-$1.old From patchwork Thu May 2 11:16:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 13651628 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94B76C04FFE for ; Thu, 2 May 2024 11:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rLtrCfbttd+0SoJ/XWq97uXEn3Y6mqjQj0v8g8tzwek=; b=mS3XerJdiSp9ri FPMNXV0tgQ5s3aMABWjoFUV6XQOnNrA08xoa/9SN8eKn0Sq19hRWovu3GPRW/U1KEjUNVZVu5CgcV JYCL2uiv9Yh+0PvORv8AOAZwhBMqDwGqIxP7s5Nv0XgN507hA3jCk+4lTzjwrsPuoRSgBxJoLAXQJ aZ0fL0AHzD1zfBstQOkBlbE2ssh1yhNV0FzdZ6B618DOGxd0NX+GAZpqJ9JbGG+CDmYijLUYXOiNI P1Vdd8AEdd3lZNLTTOVc7vlykSu5pCtAYbuoEU0PLDHIRw3SHN0pR+gfPz5gB6LbEuzvDgUqy4nB9 4fx5vEa8zb83YqwoIN+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2UQK-0000000CUFW-2I0t; Thu, 02 May 2024 11:16:24 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2UQH-0000000CUEC-3EZu for linux-riscv@lists.infradead.org; Thu, 02 May 2024 11:16:23 +0000 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id AA2F7424AD for ; Thu, 2 May 2024 11:16:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1714648578; bh=9viCGe21wce589SPhaLpq63lHm2lNcUSGMl+Cs89goo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NO4JDrlJ5V2LYeF50ULo4EQV9cLEVNlN5VdXhHO7MsnrFLA1oiOVVzEKO1fmHacWG mT0hu77H0BOKk+YI0JMlx+stCj7S0vfzXtcKg6amckZKFquEXK1e3Eb2D+zpivowjT 30heHPq39/+UfJR70IYhnkhe/nSXVO4AVHrV9nea6TH/t7F7+XCfIveCwGPuTmdn1T e9aXjwk8zT9xfB+3kR7nWV8K3XLkGHUsCMWAWmHqT3+2W1bto/iJ9RxFDey1zQeWD/ p+de5hQ8bf4w5fgSmC4RjnB4wlhehE/qL6NkLHG5gGxotesCeH3rSmagCV5005N5dK X+g7+tXeNBMJg== Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a526a77445bso504988866b.2 for ; Thu, 02 May 2024 04:16:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714648577; x=1715253377; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9viCGe21wce589SPhaLpq63lHm2lNcUSGMl+Cs89goo=; b=MPHWwfYKK78MLrsVOL9ubXHB5vyvzOb5oFhTzFYcTJDhyKKMcNapmnsLodQu9Ij+h+ ckxBa/Ks5M8bcbh+39si1FAV466if8wV4LuUirguON23AGCpvEdc8yUzC6HOlt+x7IET VniCYBWJWPGEOi0T4IpZqSsDIFwjY4aoCnuVCrifNz3z70fM0V5xoW2edZyPcpYYlM6y qmmWsy8aPy8Wpw+sLzMTLorpK5cH9/G3FvWf/MZqerFGmmVBtiAP/RCFk+VXIzbtmgGY YOsEjk+OR8jNhRMbtat5FfEVZaVVJczvYl0ggMRyRXC3Gmd4QFVFO9utuwFcqqw6yuUU k61A== X-Gm-Message-State: AOJu0Yx50ZjWtq5n8py5ENNd7VSPMJmNok/EBXeZWMY1I0Y0GBevnMkJ ZdLPN3DneDW9oPOP3F7qJO5yht+66h8mZqXlfjdEp57RGO91Ag3QBwFHWidcFyA09GTnf2Yq/iI 68jYeMBSJT0fgKmCZzQkgG9AjJ4m3WiFcaeA3yl1xJWLzjkOHbAS0xL1Nuh3Q0oO4SdvX0CAIXv b7rAwaAcQbz99LOg== X-Received: by 2002:a17:906:2555:b0:a52:19ea:8df0 with SMTP id j21-20020a170906255500b00a5219ea8df0mr1225320ejb.66.1714648577760; Thu, 02 May 2024 04:16:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0Myo75XOgrFJPJUQRXhMKXEEwYehp1jVRMzzcbJCBYoh68rOqDmHMkFSk+66SPyDzmCEKDA== X-Received: by 2002:a17:906:2555:b0:a52:19ea:8df0 with SMTP id j21-20020a170906255500b00a5219ea8df0mr1225308ejb.66.1714648577553; Thu, 02 May 2024 04:16:17 -0700 (PDT) Received: from stitch.. ([80.71.142.166]) by smtp.gmail.com with ESMTPSA id gs23-20020a170906f19700b00a4739efd7cesm437278ejb.60.2024.05.02.04.16.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 04:16:17 -0700 (PDT) From: Emil Renner Berthing To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Paul Walmsley , Palmer Dabbelt , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Nick Terrell Subject: [PATCH v1 2/3] riscv: show help string for riscv-specific targets Date: Thu, 2 May 2024 13:16:07 +0200 Message-ID: <20240502111613.1380453-3-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240502111613.1380453-1-emil.renner.berthing@canonical.com> References: <20240502111613.1380453-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240502_041622_048303_DD5DFB13 X-CRM114-Status: UNSURE ( 8.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Define the archhelp variable so that 'make ACRH=riscv help' will show the targets specific to building a RISC-V kernel like other architectures. Signed-off-by: Emil Renner Berthing --- arch/riscv/Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 29be676415d6..024482c68835 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -202,3 +202,20 @@ rv32_defconfig: PHONY += rv32_nommu_virt_defconfig rv32_nommu_virt_defconfig: $(Q)$(MAKE) -f $(srctree)/Makefile nommu_virt_defconfig 32-bit.config + +define archhelp + echo ' Image - Uncompressed kernel image (arch/riscv/boot/Image)' + echo ' Image.gz - Compressed kernel image (arch/riscv/boot/Image.gz)' + echo ' Image.bz2 - Compressed kernel image (arch/riscv/boot/Image.bz2)' + echo ' Image.lz4 - Compressed kernel image (arch/riscv/boot/Image.lz4)' + echo ' Image.lzma - Compressed kernel image (arch/riscv/boot/Image.lzma)' + echo ' Image.lzo - Compressed kernel image (arch/riscv/boot/Image.lzo)' + echo ' Image.zst - Compressed kernel image (arch/riscv/boot/Image.zst)' + echo ' vmlinuz.efi - Compressed EFI kernel image (arch/riscv/boot/vmlinuz.efi)' + echo ' Default when CONFIG_EFI_ZBOOT=y' + echo ' xipImage - Execute-in-place kernel image (arch/riscv/boot/xipImage)' + echo ' Default when CONFIG_XIP_KERNEL=y' + echo ' install - Install kernel using (your) ~/bin/$(INSTALLKERNEL) or' + echo ' (distribution) /sbin/$(INSTALLKERNEL) or install to ' + echo ' $$(INSTALL_PATH)' +endef From patchwork Thu May 2 11:16:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 13651629 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8577EC4345F for ; Thu, 2 May 2024 11:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=axHlVHy1hC7rR7HDTsIHJq91yxvT90cqE+FmFEE3JFA=; b=v0ynRi69B6azqF k1/jj4jBdmgwXVCGZoWd353/MKiL/8wWy5EOrh9Yf+o9ziRDhWkeCL3IGBNvbT1JMyOt19ecvONH4 Dz2AjUR2IYMzuUmSo0coG/RE5dnEKmEyyx9RsM699UNNvTCNb3hSNGTr8P0Nja4CFMYu5Hg5qGCtY uKkVqcknJtmXlpkbsWhLzF7SR8YuBz01X2P4ur3V+HG89HnK/zzOwr4EwGMZOzTeD7mrxz7vz7Abm XH4V5ZHnWUQgvYfTBFtZff6Tuz/3yj3TpvyNQ+cJUiv1oLB/WdWuVn4rcRrXP4Q6gyjTdZOhwYnxo 2PqPE7zk2m82iuWcbWDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2UQM-0000000CUGH-1Oly; Thu, 02 May 2024 11:16:26 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2UQH-0000000CUEH-3E1K for linux-riscv@lists.infradead.org; Thu, 02 May 2024 11:16:24 +0000 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 6A512424AF for ; Thu, 2 May 2024 11:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1714648579; bh=alIA34WXYkmJHYDf9JzzyaPI80jtTP1Uaq24imH+xTg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EbkryWGjBufFljA3LowZmN/p8YvK6PAMA9ekXXYKFp/CkTBx+n+RgyUunpNmVNqTh NcK7soAD5vI4aYuStm+A96wCIzl6DJueFD8/uJebyKpGjtOyI5TAc8vRceTyiftwTG C4CUSP9TcqBrM3uMzdzBrMU6Z0PG+uEjCaCmb3Vb9X2jl1ulzDEutqkJ3TWlyyO4sl xCOLlpr17rWhn3IpfUdRLtbctYWhWdaqtPKlvIrOffqU9791XpG19Xolh5r12pv/Zi 7Xc6yGKPMIvmqb9BbuFa2Sb+QJ1ncYixy2Wz5Q3e17NYVJoqq/J1XSKO2opHm0cs6g 8cpQVIHWH0jgA== Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a558739aaf4so467132066b.0 for ; Thu, 02 May 2024 04:16:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714648579; x=1715253379; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=alIA34WXYkmJHYDf9JzzyaPI80jtTP1Uaq24imH+xTg=; b=dxhaMnndDI6wyIoWCAeHZP7AaNkaDuH92rcqSrfWSybhORMX+EmBalSCYatuFBS4R+ p8m/1m0c20PK/IUh9lUvsXfOGX9WQ6mZ6rPFOk3/iEM+YBEwiwgbjz3kOzkFYoHNtqOM 9tV42cQrmD1Zp60Em1pJvDHw4SNzUkBWy5L+ONZ2gIu1vCDtD1u2MvfVeI0vv5YMnau3 W1Ike8/99Nl9u86Z5G1CL3JTF1WkjAmtAQLbrXWyn3qMjlWpD0dc0jyy0l4Rdgjws4bN /0ENb3gOlUQklZw5bK7f1NshtEei6awUu0b4G3ZC9j2SyW0s1tw8fBrTVMHCtgXnQcD5 sfug== X-Gm-Message-State: AOJu0YxKMtEtvwSuvI2LOqmtLXAVcPJEJ6UBu39YIe96ADRH+hbGcREJ TW/FKO6JDz0IRUFRF2Ojt92/KdcaVvbYNxieBrXE41Yfp9Lw711ixLFFJ2anXBIswRprJCY8PNx moWuuzb53lblD+rzyokPQZh9kXxTI4tMb4+JJf9tBsd+EQhDEyYPr+ebWwDiNdU/9IhFYknQjSq ZL0V4MT6RoBSPTSw== X-Received: by 2002:a17:906:11db:b0:a52:351f:5694 with SMTP id o27-20020a17090611db00b00a52351f5694mr1517613eja.14.1714648578847; Thu, 02 May 2024 04:16:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG86D9hK+ydkPVXUK/QjxllUq0XEakTYgairpW0wG9EVGdit8WtuOux1Y7bI6aIK7GFaVI/kg== X-Received: by 2002:a17:906:11db:b0:a52:351f:5694 with SMTP id o27-20020a17090611db00b00a52351f5694mr1517596eja.14.1714648578551; Thu, 02 May 2024 04:16:18 -0700 (PDT) Received: from stitch.. ([80.71.142.166]) by smtp.gmail.com with ESMTPSA id gs23-20020a170906f19700b00a4739efd7cesm437278ejb.60.2024.05.02.04.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 04:16:18 -0700 (PDT) From: Emil Renner Berthing To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Paul Walmsley , Palmer Dabbelt , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Nick Terrell Subject: [PATCH v1 3/3] kbuild: buildtar: install riscv compressed images as vmlinuz Date: Thu, 2 May 2024 13:16:08 +0200 Message-ID: <20240502111613.1380453-4-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240502111613.1380453-1-emil.renner.berthing@canonical.com> References: <20240502111613.1380453-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240502_041622_055247_BEB8BE7D X-CRM114-Status: GOOD ( 14.31 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Use the KBUILD_IMAGE variable to determine the right kernel image to install and install compressed images to /boot/vmlinuz-$version like the 'make install' target already does. Signed-off-by: Emil Renner Berthing Acked-by: Masahiro Yamada --- This patch depends on Masahiro's patch at https://lore.kernel.org/r/20240414174139.3001175-1-masahiroy@kernel.org --- scripts/package/buildtar | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/package/buildtar b/scripts/package/buildtar index ed8d9b496305..fa9bd0795d22 100755 --- a/scripts/package/buildtar +++ b/scripts/package/buildtar @@ -54,9 +54,8 @@ cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" # Install arch-specific kernel image(s) # # Note: -# mips, arm64, and riscv copy the first image found. This may not produce -# the desired outcome because it may pick up a stale file remaining in the -# build tree. +# mips and arm64 copy the first image found. This may not produce the desired +# outcome because it may pick up a stale file remaining in the build tree. # case "${ARCH}" in x86|i386|x86_64) @@ -101,13 +100,12 @@ case "${ARCH}" in done ;; riscv) - # Please note the following code may copy a stale file. - for i in Image.bz2 Image.gz Image; do - if [ -f "${objtree}/arch/riscv/boot/${i}" ] ; then - cp -v -- "${objtree}/arch/riscv/boot/${i}" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" - break - fi - done + case "${KBUILD_IMAGE##*/}" in + Image.*|vmlinuz.efi) + cp -v -- "$KBUILD_IMAGE" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}";; + *) + cp -v -- "$KBUILD_IMAGE" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}";; + esac ;; *) cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${KERNELRELEASE}"