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: 13651624 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7AB15FB9C for ; Thu, 2 May 2024 11:16:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.125.188.122 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714648583; cv=none; b=AskNVmImG7KmjW1Ou4xPZ4A7E0w/9PTH0lhhw9W4p4d2eA7r4ziYn9vxNk8wmUyX3sidhN49H5RUskil39uZxr4PR2NInO+XpkQ4w4zH8VjkBCWJfoXhqScsBR72Ep8kNrO3+lYQ22xaLbMMPpqHI6a/IVyhX2211IMvo9LofbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714648583; c=relaxed/simple; bh=7s1M5OYDc+LWVWpSbYQemQMh9geLdoxMPq2vKB3i6UI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dfdZz7py1MYRrxSxiFyDjdb0pnYUY36s+JC2jvBuiejJUs0jKNhiextYj7cgReV3DhM/zHLRu5bIOLB7gizpdeTuAYKgi98+zaUuXz98yRgvo+kkp93o9RsPwo/iik+OQy5l859K8wiEJeOqHWQV3Tf73/eV885kzhtci9AisXo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com; spf=pass smtp.mailfrom=canonical.com; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b=pYrMeTHQ; arc=none smtp.client-ip=185.125.188.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="pYrMeTHQ" 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 79B99424A6 for ; Thu, 2 May 2024 11:16:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1714648577; bh=MK9pS8zh0OAd8/YKYBCNbvjlHmkQLgxQ6JtcNKhjMOU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pYrMeTHQdc/GAlzvqrj7eE9T2mEidGKOMlWp2p9m1OtcLvEY7gHd8y+s6DbpnS8uL LHi+K3f7230giwlz0lPBtJBwiCkfv+ylroSwipXW54fs/mzEwgdTaos04gtmaDacTW Fya3tiwEfTxTgqCRgFX0XGoWovqTNQs60VmBoe9vySPgdEIyMBVAcKZBjAem+zVMcf sQCsVlwHbn9yVH9HhPoPNxjs3jWOTDmM7t/I0wyxZktamGf+ET8/NK3ArmXfJDmaxV 3PjDoMX5ZB5Nn3PuSCQCw4GF42yy+3DTjCaQoRWRGEMA+8MBoaK1S/0APUodC5Du7q SSw3iRA//nZsA== Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a592c35ac06so180905666b.0 for ; Thu, 02 May 2024 04:16:17 -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=xS6NFDRBgO2AtlFYxKChYUC9AiUNX/EbsftRpcwSovR3JI5D9DCtA02AIUsc+jCH3B +XyArJ0aWPbnSiMy9dZauVA/cwpi8KtyJAr6SJ9uF+l0euJ4QcmkVvwSCXceuAKEkS/T q6bwcKz2i+G9l8TzO8oL+gmVyj9rurWC7XPh4W5aC87jAIMI+ARYL6XPVn4Mq+y6FDmG 91Awm40h4+aVcFoaQwDNG3WIki0lLf1b1yyoc0mebxD6LTfaYtYnsIZmWhVGwPdsTK2O X+CENEX3fZ4MFHjkrBs6lNJS4h8yFXkoQ7yWF4xydkFAwsYAsiI9kvYGU2LVvr2Xf9fx /wRg== X-Forwarded-Encrypted: i=1; AJvYcCVp7b/7EaZ9U/MT33S+2Idtef6laRKX/19ohmTlmT/jG9C5ipT3hzUiI/SHc6ROxq2Kgwx74FRSoN3qf7gXU4R2BH/6cpjG3Y/jchIW X-Gm-Message-State: AOJu0Yynu4tKq+NALsHSxc9WjHw9k9Vm5VC5UKKW5/YeZ+ttn4zxdP7a nDqbvi3ceQ4Vtvbn5YgKbKC8Ss1qbxB1pbheAYQUhn/hmdGLJ6bapdkwiKdW37l7Npr0fL0KRgG G+PLHMsthuRBeAe2pnpg9Wh7PBHdGnBPVizA9kfqd5q91tisNI+uVEaFCo5vtiYkvrgFVVR0pde G5bA== X-Received: by 2002:a17:906:248b:b0:a58:eb0d:f2a6 with SMTP id e11-20020a170906248b00b00a58eb0df2a6mr1882992ejb.31.1714648576877; 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> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13651627 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AF4464CE9 for ; Thu, 2 May 2024 11:16:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.125.188.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714648588; cv=none; b=aTkKOXPttnPkY4e/ee/1FFvu4TFxpGcYzXDYZif16ivucz7hPy8xE73Sv3DCac8bSSyXAQpT2TWOnuojTHnuPavb7XEvAl/Jm1w1Yaml5rkEnjdmobijdweaK9Zzy/QFORtqdu5MAONgrVLQVcjkkjpZ546y9/a2EWLswVSh6PU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714648588; c=relaxed/simple; bh=jAfPxDaZQf+Z3EoMBa2T7YQWg15qnOSgj0+XC4k/BRE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=itSDbGvDeu3A+nTQT5THaoH7HcTg6qNB6sgU27PqESyyLvzIqZxbXeL8H/DvwiQb5Z7CwUTVXWymF5+pMey/JR9u/1Ubmn3lbIohExGjUQnS5UyP+YuRejpe0pB7Fw1LiaSt+iDRfScEXxkGrV9sGe+GNbG2kKVjHTD+/zOET5A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com; spf=pass smtp.mailfrom=canonical.com; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b=cYQ5Laz6; arc=none smtp.client-ip=185.125.188.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="cYQ5Laz6" 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 83EB03FE65 for ; Thu, 2 May 2024 11:16:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1714648583; bh=9viCGe21wce589SPhaLpq63lHm2lNcUSGMl+Cs89goo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cYQ5Laz6Tc1+9ENHzXCRgqMYkYVj8L99N5CsyEukH678PeZKJo0wJSD3IvTYaBe3E Pm9rRGOd2VjEU6w2LSGIcfuMgun6vsOPRWFi4g3guJcxALpDKvyFjNaKaRA2uOSptW hQ3vRCeMyW3LX3bjozwGkba81OS5hKLpeq+B9JBlWMW0+IIx/Q3MuF6heCJImaKdeE kZ9Qeg3ZmMhx4Jw49nshZpXo+ylU2Vi91XeskMDxMwZWEFQV0M3MtIkYRqhIKlotMJ pnKjqRm7L1JE1GNZhR7oh8DqBcGmP7g8FYRHZxfoSE7HY8ks86F2+aNBQPlGJG6LBi yo5ObIip/2jAw== Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a595c615537so70648766b.1 for ; Thu, 02 May 2024 04:16:23 -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=bw/hVvQ2oNbiHfP4FJS907h6dBLeeqlhjsbFCEBFjF3pfVqHthUJj2T54Jaf6ELNLC OuMThJ5q4nn++hSLZbvRZFPpI3Aj1w0EdPy29sypqFx2zgH5AKchKFAjnvT9CZfVRjSo 2/zv1rTat6pA2dwJsTGsJLQcoxMrcLoFDzqoInWN/x2oAdhw04cPiBlbyDTZwk1eUkXw /BDEkCF+iVqZtU2RTliU+IcBFK9z7xwIzL/NAbYCU80JK1FM4HNSnEWvP1kWVKVjiw8U VvpSgPyBqFPetzz4y+sd+ce/4GkVsjWYmfrZjGeQEsVhfrc7948FGRXUPez0HzZZZXo0 56mA== X-Forwarded-Encrypted: i=1; AJvYcCUucPsT770FfbqKo6Mr38T+ksI6ITZ9i93NHy8wbL7h2Tl0/Jm1MMbldCel4PiwNJy42hWeIRjhPiJV3eqQPNtgmGCDTJLXPiGy4wqp X-Gm-Message-State: AOJu0YzgwvRw2Coi8FUTwp9mLn+u0UcHOWvIWrkJKMQ+FhD2ExH4/gXx ivkEuq5LdP9mJt6C9bhhVzMDrOnlHYJG8ceifXz43K4op6V+5WkREuYx3n9g6vYE8NBAUjtJqKB T932ut5BDE6/zXUkM738f/1+GVBeD9ZTt8SAteMLLhaHhA25DbA1nv+nrpeJnWIuhPnqllIqsWI SGwA== X-Received: by 2002:a17:906:2555:b0:a52:19ea:8df0 with SMTP id j21-20020a170906255500b00a5219ea8df0mr1225321ejb.66.1714648577761; 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> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13651626 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6B0863417 for ; Thu, 2 May 2024 11:16:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.125.188.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714648587; cv=none; b=ipRkZ43BPDpiYY3oB3xQzZMC4fDk5pfwFrGW+5RnlChjPiSrbrU4fMbyJ2WVz9H7AwPe5qvCLOqng0aJESAV5LptA+lTiGQHsQAHQLJ37GMTqHneIKC8Gdvu74TvkGyqORHQ+ASgG3ZRmz25DXBl8qItbGkc7uRIm6kIF6BckPQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714648587; c=relaxed/simple; bh=YBmIuvux2Nz3WQf1dIIQ6Ld9PE8PDzjfaHfR7DKWMGc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WB+1yNbHPtV52P7+hCBrr0tzsvf4ERKJm+dBI0Y27+uMCgeFu0EoqtC7YJLHw1ES9UWdcVR2eD6VM35LfraBLBPO9OJ4ag/umEYWTBU8BIBu81oyXyqJ2VkC28e2RrFMRy/4hHYOGck9xeD/x2C5y0md5gGCgmRkUg+ZtEKN8dc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com; spf=pass smtp.mailfrom=canonical.com; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b=LdMGvnXl; arc=none smtp.client-ip=185.125.188.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="LdMGvnXl" 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-1.canonical.com (Postfix) with ESMTPS id B297D3FE67 for ; Thu, 2 May 2024 11:16:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1714648583; bh=alIA34WXYkmJHYDf9JzzyaPI80jtTP1Uaq24imH+xTg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LdMGvnXlzUHzVWCcs6Jk2n0gC/FLseG46T/R5Yz+KzhrHKzmvMOjDm/CqJ7c0aBoX aHHxoxhcWLtVxPWjKtwf5yShW0irYpH+Ov2GGLl7s12wMkB3SdLxMCRIz1cPLZ7UGY KC+ngJgRjWbElbNJU4bIBT5fw5ZEmbOejdQSU3tYVGMLHwWQnBUSk6aZk9sNE+Jw1c PXX0dlk/YE7LVDU6UBtJaqOyg1UxTJjs8gDUmvWjqewR+V4UNCTJ9IPOC6wyQvQaub aJbLVghZiTYqp67xGxDJgodsS6oWsXq5bpJazjSQBiJG4WTVsuUe81NzJIjY+zH2Ka Ayile8J8PG2gA== Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a55a8c841e8so409191366b.2 for ; Thu, 02 May 2024 04:16:23 -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=jwBME/7wqBwJY3colSgu8oiXouHyeZf/iMuoUTm9LwPk8/32F/NY94qjW5Tg7mqw0K jed2soPmHAry4jooutQscyODJyrgFCl750oSzYcj7JKgT3DU7vAOCejLdno9WqjzfoeL gzxGZM93Y8L2T0bxGRvPDokYfqhSzdaCnVEY/byoEgov1BF4w+8fTfWDbN0TbV6sS4kz p82tAH3q0OsT3RKO+OhrZvGd4IM2wDzWELohFkRGhOwhgVwF5mKelKSedmfrk3vkqeX5 8doGbimS8QRIbkxBSYc1MEk/hC3l5O1SclnfmcpPoMReKD+DkYIU9fTt52RjFrv6Ef1O GF5A== X-Forwarded-Encrypted: i=1; AJvYcCXtdf2+xx1N9K8vU2oBpy6O3Yr9ita6R29KU1ggTvl2kwWJ7aO96uiam8Aix3cz2gjOux847fXwaHiPChz/YK2b3YrgW+g9EduRwsrZ X-Gm-Message-State: AOJu0YzJAxsDZ4OJTlJQ1+WTxI840CMFKNR/DJPwTHyaywC8Ztl3UlqV LyFt77CLrX8K3hV4cMkuVaiSRm/DTnqon8La5bLfhUHO0qOLUZ+t1yZu5e2ZPXFY0gb2u/5mvP1 +D1R9YjvAJhVYSekHuDYQQukevhlqA9QnMpCn5nZd9qDgYXUNTUbi5v4U+gk2BfaRGL5sHF8RSB tFLw== X-Received: by 2002:a17:906:11db:b0:a52:351f:5694 with SMTP id o27-20020a17090611db00b00a52351f5694mr1517614eja.14.1714648578848; 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> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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}"