From nobody Wed Dec 17 22:48:18 2025 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 5DA8264CFC 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=dngQmLG9zDWgFyjAiBjblfxpJXxGptKCaoYn2llKe4393/hpDNhS1JFuES9JXE1BbPwsCFoci/xVcbkkC1MLmkxpCItt753rRMkWvNrXWmb+9N5ixSHDVNaOpFN/H0iS21PZ6uHyCricSX2hgG0ek7Xl+3Xph2oAsuzfLNzHcBY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714648588; c=relaxed/simple; bh=7s1M5OYDc+LWVWpSbYQemQMh9geLdoxMPq2vKB3i6UI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DNT7v+tAFj4OEmTl/vBQHHyVX7E1n5g19zq4yeh0mW4lui/eu6vVGMdshYSO1a+iEjqQ27U6hOqBKwrNV3N6e9VpyN7kolU1XA/KWEQfsW2c2Ey1GwgH/91kwxUbSIz5mCchrN4/SZUYFKEWVfyan2btb44H/h1/xkjMFTVPL5Y= 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=fKx7hk+U; 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="fKx7hk+U" Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (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 8C5833FE62 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-f71.google.com with SMTP id a640c23a62f3a-a592c35ac06so180905966b.0 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=KyW28zlPe9x0aQNX/VtxRKZ0vNVnFjbZ6JnSFLqDqz7iFQno89LQWYVY1h1Ln0SROH Q65givqbSEYyp7euSditKFHRIvxEra6PuRoxUS3bOmyL+lcCerLfiij2uHa/sMe5dwiw opey1Ol6a+nQmccIF4Voej8sV2+gz73tz9atAfq3SRJ+6Zb03WntZ9BaucH7PYGFbELQ oLl4lwEH+5OoiWT4M9hQnoiL2NGktNVoVfN1/61tyd3LOZlG9RobBjJ6do22ilmwQuD0 M8piXPPpEDz6bXueBU8E4WOd4m8ciawwy9PgdDN8m7iHe2MGqiYK7hlxUcTyCHtBdQxN +ABg== X-Forwarded-Encrypted: i=1; AJvYcCWiipVDof0W01bALntyt1toSV6KAj8rWtrB4MMgBWo7r59A6jVnC+YffwaiXwL5/w9+CB2o4ZRgd7frT3h9xpkDs1LfL45bodIdKmmE X-Gm-Message-State: AOJu0YyRg0FGlDrav94sEBFhYrP68PBTB/Kytjg90SjAA9yghDv14HxK 1jjS+KD00eg/yt1X3wa4lnNaSw4i3At+PZaAh4Tq5yAZ42mfbvIVJoh1QZDxPtO1iPLhGysRNbT MuWLcrxSt4rzHXhFK48q0mF7877ilq+jRnb89JRfVdIjK3NVvZrCp9rpCdoyUCcmM24k0MuQ0mm wbI0rwDYnd+w== X-Received: by 2002:a17:906:248b:b0:a58:eb0d:f2a6 with SMTP id e11-20020a170906248b00b00a58eb0df2a6mr1882989ejb.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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Tested-by: Bj=C3=B6rn T=C3=B6pel --- 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 +=3D -D__riscv -D__riscv_xlen=3D$(BITS) =20 # Default target when executing plain make -boot :=3D arch/riscv/boot +boot :=3D arch/riscv/boot ifeq ($(CONFIG_XIP_KERNEL),y) KBUILD_IMAGE :=3D $(boot)/xipImage +else ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_ARCH_CANAAN),yy) +KBUILD_IMAGE :=3D $(boot)/loader.bin +else ifeq ($(CONFIG_EFI_ZBOOT),y) +KBUILD_IMAGE :=3D $(boot)/vmlinuz.efi +else ifeq ($(CONFIG_KERNEL_GZIP),y) +KBUILD_IMAGE :=3D $(boot)/Image.gz +else ifeq ($(CONFIG_KERNEL_BZIP2),y) +KBUILD_IMAGE :=3D $(boot)/Image.bz2 +else ifeq ($(CONFIG_KERNEL_LZ4),y) +KBUILD_IMAGE :=3D $(boot)/Image.lz4 +else ifeq ($(CONFIG_KERNEL_LZMA),y) +KBUILD_IMAGE :=3D $(boot)/Image.lzma +else ifeq ($(CONFIG_KERNEL_LZO),y) +KBUILD_IMAGE :=3D $(boot)/Image.lzo +else ifeq ($(CONFIG_KERNEL_ZSTD),y) +KBUILD_IMAGE :=3D $(boot)/Image.zst else -KBUILD_IMAGE :=3D $(boot)/Image.gz +KBUILD_IMAGE :=3D $(boot)/Image endif =20 libs-y +=3D arch/riscv/lib/ @@ -153,32 +169,19 @@ endif vdso-install-y +=3D arch/riscv/kernel/vdso/vdso.so.dbg vdso-install-$(CONFIG_COMPAT) +=3D arch/riscv/kernel/compat_vdso/compat_vd= so.so.dbg =20 -ifneq ($(CONFIG_XIP_KERNEL),y) -ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_ARCH_CANAAN),yy) -KBUILD_IMAGE :=3D $(boot)/loader.bin -else -ifeq ($(CONFIG_EFI_ZBOOT),) -KBUILD_IMAGE :=3D $(boot)/Image.gz -else -KBUILD_IMAGE :=3D $(boot)/vmlinuz.efi -endif -endif -endif -BOOT_TARGETS :=3D Image Image.gz loader loader.bin xipImage vmlinuz.efi +BOOT_TARGETS :=3D Image Image.gz Image.bz2 Image.lz4 Image.lzma Image.lzo = Image.zst loader loader.bin xipImage vmlinuz.efi =20 all: $(notdir $(KBUILD_IMAGE)) =20 loader.bin: loader -Image.gz loader vmlinuz.efi: Image +Image.gz Image.bz2 Image.lz4 Image.lzma Image.lzo Image.zst loader xipImag= e vmlinuz.efi: Image + $(BOOT_TARGETS): vmlinux $(Q)$(MAKE) $(build)=3D$(boot) $(boot)/$@ @$(kecho) ' Kernel: $(boot)/$@ is ready' =20 -Image.%: Image - $(Q)$(MAKE) $(build)=3D$(boot) $(boot)/$@ - -install: KBUILD_IMAGE :=3D $(boot)/Image -zinstall: KBUILD_IMAGE :=3D $(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) =20 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) =20 -if [ "$(basename $2)" =3D "Image.gz" ]; then +case "${2##*/}" in # Compressed install +Image.*|vmlinuz.efi) echo "Installing compressed kernel" base=3Dvmlinuz -else + ;; # Normal install +*) echo "Installing normal kernel" base=3Dvmlinux -fi + ;; +esac =20 if [ -f $4/$base-$1 ]; then mv $4/$base-$1 $4/$base-$1.old --=20 2.43.0 From nobody Wed Dec 17 22:48:18 2025 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 2968A64CE1 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=1714648587; cv=none; b=Ge9UCPUETQredf5M0TUocn8DSMEbAT2QOdTeCALJVmRESWPBJ50pR7qdmxgg0XifB+geQbcZw6CDzHkRV0/tKK8lWpM3oezo0garRTK+2LAF+4g1qMenPr+nmygB4wUeQbcdaDXSB6SpMNUlR4OpemQ1ohhANV1Ow631jorVia4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714648587; c=relaxed/simple; bh=jAfPxDaZQf+Z3EoMBa2T7YQWg15qnOSgj0+XC4k/BRE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e88ayRY37bElMAQpF918kr3fbmJNoA7Cs+VeGm2F6JuvzqXgLxkFCVRSp+vz3xP5lvFxJSPw9k8MTQOe23uHTt5v6Iq3l/NZtMI+Iackrad0yevCfEkz7QEouBzy2ybzTT4htd1QhBXEjq51T20V0CfyZdXMUlxsp9U49DasVfk= 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=XBPQRvcj; 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="XBPQRvcj" 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 BAD223FE64 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=9viCGe21wce589SPhaLpq63lHm2lNcUSGMl+Cs89goo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XBPQRvcjxx+qiYmBQ0T4dv8RbPvuHEe3jYPS5UXX9VLELwIHEbzpt6n+TVjYVvYz2 owovTOpuv8Fp3V0WZeY8gyuHgGh+s6mFwMOVVDkPCeCvYqA41XagmpRksS/yQTdc6c 0zYhlDX3fZFw7cCYImGYZnkWl+ZoFSJ5Kp4JSGNrtd+Ki1YuVnDngB9dTq+MNoNnB4 xHzAu1pZ3FysTrvQkkmsCNT6Em8D6shv3EFMWPnoOCvQKhWGCynSqpAINRa5O965Ij Bq9bX7/LpUnO9p4V+31Fzw8CEShG0juj8P9h+2V8fb29BT3baDc2nEGaiJyJidZZvS h9NOPNd69qJDw== Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a4455ae71fcso420270466b.3 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=9viCGe21wce589SPhaLpq63lHm2lNcUSGMl+Cs89goo=; b=uMgPWNQBHnEGJyyj7eWrux4RIiueoJ84fIWH+rfUgEwGSWH8T8ch3RcPtwynAUoegz tK3Jnnikqx22J9Ig3M5UPlp5Wkl8TFB4RlLH4QA1ezzqj42NIazYC3lKT6cAIrW+2+B4 yysHvp/hirJfA1Br/UHLs/d+Ze/8LF7eqj8cJdjwWY4/aj3cwqKzXFc6lX7oHf7TFvUF QE8uECJkyni9w7ND8AkIYd63Uxuy4nm/6AG16Rf7z3O+romI9sv9EVjs8hwVLwJEn1BA nsA4cBoOtGdWtbaXs3r5MXdGtc9TAhxQLGj/4zk1AkG9G2LFkEy0dGrKT0QRN4v5uXsi 5IjA== X-Forwarded-Encrypted: i=1; AJvYcCXOCGHShCPjSQGJImjF3QdH0DTG8bro3PR10PGnpdkZpohebqfT4shtSl1ejIa9hBJJ05v5wxlDpy+/0UdBh3b2eN0u2yw6ohPUtpSg X-Gm-Message-State: AOJu0YzmlMjxZOjSf2G8RK1ABifNxhAM2Pt+CPsIIA7Ij+tTSWm1ILQq x8RonGZkW6iX8+Kjj+ZN5t/zCrfqqAB0EKja2R4hI/pEgyzP8wexgVbDL/KLSvjrn9gE9dHDAey TZxP26H6zKVnOh4p54U2bkI6Hxm6YOeAQQbF/1lUjvnHIuYQJFYvZO8OqoDwqVK3Imr2yKcV1ot tPHg== X-Received: by 2002:a17:906:2555:b0:a52:19ea:8df0 with SMTP id j21-20020a170906255500b00a5219ea8df0mr1225322ejb.66.1714648577763; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Define the archhelp variable so that 'make ACRH=3Driscv help' will show the targets specific to building a RISC-V kernel like other architectures. Signed-off-by: Emil Renner Berthing Tested-by: Bj=C3=B6rn T=C3=B6pel --- 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 +=3D 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.lzm= a)' + 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/vmli= nuz.efi)' + echo ' Default when CONFIG_EFI_ZBOOT=3Dy' + echo ' xipImage - Execute-in-place kernel image (arch/riscv/boot/xipIm= age)' + echo ' Default when CONFIG_XIP_KERNEL=3Dy' + echo ' install - Install kernel using (your) ~/bin/$(INSTALLKERNEL) or' + echo ' (distribution) /sbin/$(INSTALLKERNEL) or install to ' + echo ' $$(INSTALL_PATH)' +endef --=20 2.43.0 From nobody Wed Dec 17 22:48:18 2025 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 ECC4669959 for ; Thu, 2 May 2024 11:16:28 +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=1714648590; cv=none; b=aGBPunSN4WpXhmHkbTK99+tVS+EM9gju8FGmP6B5RIIP4UqWfAqGvZ+SWSoerRVA+tj+WTQUROfVQWOqJBQIDLsP78hz2CIaZlenSO7EkY8CaczBkyf2xl4dVmnULaVMVkTnDs9B9CSJyFSMvS1NcKdVgzRxM0uQBn/4MxWwcLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714648590; c=relaxed/simple; bh=YBmIuvux2Nz3WQf1dIIQ6Ld9PE8PDzjfaHfR7DKWMGc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LRyaq+pXhVNLO6KpvhDxqXgPD591PWejbohZlqJhwv8a28R40hIZBbDprPjPfDvXpYGr7762t+adY3DoMRMTZQgoNkXkMm3IJQAl4MvmUYxlTXyjiRxRLEuF49wA6r41TcjUlSi0zfDwJ758KE1h40NtgV2G0RJOqQzlIUOshhc= 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=UBCxu639; 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="UBCxu639" 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 1352A3FE6D for ; Thu, 2 May 2024 11:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1714648585; bh=alIA34WXYkmJHYDf9JzzyaPI80jtTP1Uaq24imH+xTg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UBCxu639vQImDUVx8mVJ+0buLHcnoIlizToRJF6V+F3NGQqODsY+JS2MTHkdXffh7 5pEjooilSH7SoCD+0rW4nCFrtS1xv4HHSwtaZJRS60Ow8gp5N6M/GoiWvZ3WneZcAD fJu+w12nCormA2hCgWnwAx3uEhMFCgG5P1vrpsDE/rjH8cNV57jCXlHt7EEfQbv/R+ Y2J1stqLvtGkHHsrcklkAzPCey4uEDG0wqM6OdPWHcCCnhFWKep37wA2qW0IsmABnt ss9arEIPpKga/RqVw53VxxWRmaHAUvg+gKab/1SXY/5oDRlWqsgENX5SuG8a/FFP5E MYzxD/C6KwbAQ== Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a558739aaf4so467131766b.0 for ; Thu, 02 May 2024 04:16:24 -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=uKS41Po78JLl2FB++tXWW1cVwjC8FOjwAwCZ8jvlS5sQY7wRLI6I2cp1n90DDSotWy OUIhXXNJ6Ku98MdYXMQGWuDQrDUW8qTlSqhCDxbNH/mATqOpTtLiYc8nIQPvj6dFBt6l W4CibKL7fhr34oJ2lVEWpi7oJJY6dTLj6Z36rRHFz46KYTjxy9KXkkumrQJ0MwELzKg+ CYwXNlURqm3OL2Mo+64I2LSua0O04MPdV9cCZCB7UQsnTuJhtYDRPDAoXczvTJ0SGSBO IxlSgQsXvXVCjMTkIoqEGa6CxNWeyn+GIH+RS/sYbJNTVIm7GCgVceeT05yH97Hupnd2 SUeA== X-Forwarded-Encrypted: i=1; AJvYcCVlCCxKodgItWPa8Q82zp8Z77egp547Gc8J2Cg5HmcFBw53oRXNbhms6jDrWloADQSJWWqLv+OEWK5g79xducMjxwRW5am7sX4hXYGr X-Gm-Message-State: AOJu0YzF36ojcKgsj5n3PcXozDtC4ennut/35fpmhYILnw7tGRn974TV 4WovrEEfxscmY+Y1k8tSS75aRQmG8mMGWfv/SB3UPwcuwVzWYimCfkDuUBPIdHS51mSueQkgR6X qiIurqMBUh+i9jMEisl3bvSMMt1MWanW7jBbrZ9Lb/m9rs5wJHG6sACGR4m2QhASDgF2Q+Vt+x2 rmSQ== X-Received: by 2002:a17:906:11db:b0:a52:351f:5694 with SMTP id o27-20020a17090611db00b00a52351f5694mr1517621eja.14.1714648578861; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Tested-by: Bj=C3=B6rn T=C3=B6pel --- 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-${K= ERNELRELEASE}" # 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 t= he -# build tree. +# mips and arm64 copy the first image found. This may not produce the de= sired +# outcome because it may pick up a stale file remaining in the build tre= e. # 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-${K= ERNELRELEASE}" - 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-${KERNELRELEAS= E}" --=20 2.43.0