From patchwork Wed Apr 7 05:34:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186877 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E25F3C433ED for ; Wed, 7 Apr 2021 05:34:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8C90613C0 for ; Wed, 7 Apr 2021 05:34:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348701AbhDGFeq (ORCPT ); Wed, 7 Apr 2021 01:34:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:38106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348698AbhDGFep (ORCPT ); Wed, 7 Apr 2021 01:34:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5942D613B8; Wed, 7 Apr 2021 05:34:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773676; bh=B51G6VIlXTzxHLkCKj6iCowgp4FQbLOr7V65C4Er3Ws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZFc2gDty79xu113KxeHIcAEPjptzuOie6tR1Fs+nqswq/li8v5D5Ea7D5oteZuOtm uHqLR7wBeV0Vap9ZL+fHU5d4C+zUi+NRH34SuPbTvFwjcmgo31F887/jiDn4pWxPtt EqVgM2jaKfBUhY/O+gPZ1iMId2IcQHvNQvR93WC8= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org Subject: [PATCH 01/20] kbuild: move x86 install script to scripts/install.sh Date: Wed, 7 Apr 2021 07:34:00 +0200 Message-Id: <20210407053419.449796-2-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org To unify the different architecture kernel installation scripts, start out with the one they all were based on, the x86 script. Move it from arch/x86/boot/ into scripts/ so that all architectures can call it in the future. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x86@kernel.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Kees Cook --- arch/x86/boot/Makefile | 2 +- {arch/x86/boot => scripts}/install.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {arch/x86/boot => scripts}/install.sh (100%) diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index fe605205b4ce..17c7718c1a4a 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile @@ -157,5 +157,5 @@ bzlilo: if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi install: - sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/bzImage \ + sh $(srctree)/scripts/install.sh $(KERNELRELEASE) $(obj)/bzImage \ System.map "$(INSTALL_PATH)" diff --git a/arch/x86/boot/install.sh b/scripts/install.sh similarity index 100% rename from arch/x86/boot/install.sh rename to scripts/install.sh From patchwork Wed Apr 7 05:34:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186885 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFA6EC43460 for ; Wed, 7 Apr 2021 05:34:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B722613CE for ; Wed, 7 Apr 2021 05:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348733AbhDGFfF (ORCPT ); Wed, 7 Apr 2021 01:35:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:38348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345241AbhDGFfE (ORCPT ); Wed, 7 Apr 2021 01:35:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 20C19613B8; Wed, 7 Apr 2021 05:34:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773691; bh=nADdg6PM/j4BMDvlY9mRZPDHGBnkM2Jn+KFDAec2UDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xKPdKMGmCnJqujbtVQPFWFBrjKsYjxexM8pJMjYN9Sppty8vctYiBQ9lIL6oxC5Ih HkAI4ZTZgJjmCrrw6Dln6p4xlKD586JvV7kcwH0Wn2fLSYNI/e5xyokeBZZWQVvNMr vpLOg92uNdZFeLU0H7nCo7H16hXq+cQwrTSX2by0= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables Date: Wed, 7 Apr 2021 07:34:01 +0200 Message-Id: <20210407053419.449796-3-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org A few variables are quoted to handle spaces in directory names, but not all of them. Properly quote everything so that the kernel build can handle working correctly with directory names with spaces. This change makes the script "shellcheck" clean now. Signed-off-by: Greg Kroah-Hartman --- scripts/install.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index d13ec1c38640..c183d6ddd00c 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -33,21 +33,21 @@ verify "$3" # User may have a custom install script -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi +if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi +if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi # Default install - same as make zlilo -if [ -f $4/vmlinuz ]; then - mv $4/vmlinuz $4/vmlinuz.old +if [ -f "$4"/vmlinuz ]; then + mv "$4"/vmlinuz "$4"/vmlinuz.old fi -if [ -f $4/System.map ]; then - mv $4/System.map $4/System.old +if [ -f "$4"/System.map ]; then + mv "$4"/System.map "$4"/System.old fi -cat $2 > $4/vmlinuz -cp $3 $4/System.map +cat "$2" > "$4"/vmlinuz +cp "$3" "$4"/System.map if [ -x /sbin/lilo ]; then /sbin/lilo From patchwork Wed Apr 7 05:34:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186879 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF130C433B4 for ; Wed, 7 Apr 2021 05:34:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78A81613C6 for ; Wed, 7 Apr 2021 05:34:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345226AbhDGFe5 (ORCPT ); Wed, 7 Apr 2021 01:34:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:38248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345230AbhDGFe4 (ORCPT ); Wed, 7 Apr 2021 01:34:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 65CCF61168; Wed, 7 Apr 2021 05:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773686; bh=Ap6X9FPkMU0Lq3Uh/N+daHn0QRFCYA0Bh3YUBOeqXvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zDJNB2hiQMshLeFAIxxzwHkK7jXwMfsDHFZal5KRlsyjLWRbVPgxrPVfVpGcEyHHC icS/c2eIoytAOA41UJtHXRMT7QCrr/3sLMnhpt6qUybW8phqpYRBQ+/NcSXZeMWFUx MFNF4XttedJPsMkupgscXzDdzV9qorRUdDnr5dCw= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 03/20] kbuild: scripts/install.sh: provide a "install" function Date: Wed, 7 Apr 2021 07:34:02 +0200 Message-Id: <20210407053419.449796-4-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Instead of open-coding the "test for file, if present make a backup, then copy the file to the new location" in multiple places, make a single function, install(), to do all of this in one place. Note, this does change the default x86 kernel map file saved name from "System.old" to "System.map.old". This brings it into unification with the other architectures as to what they call their backup file for the kernel map file. As this is a text file, and nothing parses this from a backup file, there should not be any operational differences. Signed-off-by: Greg Kroah-Hartman --- scripts/install.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index c183d6ddd00c..af36c0a82f01 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -27,6 +27,19 @@ verify () { fi } +install () { + install_source=${1} + install_target=${2} + + echo "installing '${install_source}' to '${install_target}'" + + # if the target is already present, move it to a .old filename + if [ -f "${install_target}" ]; then + mv "${install_target}" "${install_target}".old + fi + cat "${install_source}" > "${install_target}" +} + # Make sure the files actually exist verify "$2" verify "$3" @@ -37,17 +50,8 @@ if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi # Default install - same as make zlilo - -if [ -f "$4"/vmlinuz ]; then - mv "$4"/vmlinuz "$4"/vmlinuz.old -fi - -if [ -f "$4"/System.map ]; then - mv "$4"/System.map "$4"/System.old -fi - -cat "$2" > "$4"/vmlinuz -cp "$3" "$4"/System.map +install "$2" "$4"/vmlinuz +install "$3" "$4"/System.map if [ -x /sbin/lilo ]; then /sbin/lilo From patchwork Wed Apr 7 05:34:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC460C43462 for ; Wed, 7 Apr 2021 05:34:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81D12613E4 for ; Wed, 7 Apr 2021 05:34:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345230AbhDGFe7 (ORCPT ); Wed, 7 Apr 2021 01:34:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:38270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348708AbhDGFe7 (ORCPT ); Wed, 7 Apr 2021 01:34:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BB888613B8; Wed, 7 Apr 2021 05:34:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773689; bh=wgqLKCpv5Q1vEaaFl8xvuInNNea8k2m+fFzOdqUbyw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0FOc29ZGjx5iCyoeD/hFnnJMp6MK22rKftLmPC/k2fkvWM/woCpNyQx+frfwPs3OG e+SiqrJrJX+j3b6BuVmjurM3bKSh5vIHLpHIsqQdkYAxgPJa8FQmJ31QBIrtU+o/bF CB3tPwEEateROLJts7jwJpvdbDeAhoNCm0QxJjXo= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 04/20] kbuild: scripts/install.sh: call sync before calling the bootloader installer Date: Wed, 7 Apr 2021 07:34:03 +0200 Message-Id: <20210407053419.449796-5-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org It's good to ensure that the files are written out before calling the bootloader installer, as other architectures do, so call sync after doing the copying of the kernel and system map files. Signed-off-by: Greg Kroah-Hartman --- scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index af36c0a82f01..92d0d2ade414 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -52,12 +52,12 @@ if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi # Default install - same as make zlilo install "$2" "$4"/vmlinuz install "$3" "$4"/System.map +sync if [ -x /sbin/lilo ]; then /sbin/lilo elif [ -x /etc/lilo/install ]; then /etc/lilo/install else - sync echo "Cannot find LILO." fi From patchwork Wed Apr 7 05:34:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186915 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 028DFC433B4 for ; Wed, 7 Apr 2021 05:35:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF8E2613CC for ; Wed, 7 Apr 2021 05:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238882AbhDGFgD (ORCPT ); Wed, 7 Apr 2021 01:36:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:39072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348808AbhDGFfm (ORCPT ); Wed, 7 Apr 2021 01:35:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9ADAC613AF; Wed, 7 Apr 2021 05:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773733; bh=gLoJ516uqKiucx6WRY0TlVov1Wwhx5YWTL7Jb2S9rMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DSc+53E7iJBo9rRyDlEgQM3yAP3O80Tk4OWDSXGQhLyjnioXJA7+cKZNbaBDvdtRt U8F3ywI3N9PlJiAJvANFVNQkEo33HExlJvQQQcEtZsz2DPc5JQZ5EtzP0brNA6IcUx /kJLcf6M47uvVpWJDIlihbVjO6pxB27rk4bE/Eh0= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 05/20] kbuild: scripts/install.sh: prepare for arch-specific bootloaders Date: Wed, 7 Apr 2021 07:34:04 +0200 Message-Id: <20210407053419.449796-6-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Despite the last release of LILO being in 2015, it seems that it is still the default x86 bootloader and wants to be called to "install" the new kernel image when it has been replaced on the disk. To allow arch-specific programs like this to be called in future changes, move the logic to an arch-specific test now. Signed-off-by: Greg Kroah-Hartman Reviewed-by: Kees Cook --- scripts/install.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 92d0d2ade414..2adcb993efa2 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -54,10 +54,15 @@ install "$2" "$4"/vmlinuz install "$3" "$4"/System.map sync -if [ -x /sbin/lilo ]; then - /sbin/lilo -elif [ -x /etc/lilo/install ]; then - /etc/lilo/install -else - echo "Cannot find LILO." -fi +# Some architectures like to call specific bootloader "helper" programs: +case "${ARCH}" in + x86) + if [ -x /sbin/lilo ]; then + /sbin/lilo + elif [ -x /etc/lilo/install ]; then + /etc/lilo/install + else + echo "Cannot find LILO." + fi + ;; +esac From patchwork Wed Apr 7 05:34:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70B95C433ED for ; Wed, 7 Apr 2021 05:34:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A255613CD for ; Wed, 7 Apr 2021 05:34:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348717AbhDGFfE (ORCPT ); Wed, 7 Apr 2021 01:35:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:38418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345238AbhDGFfE (ORCPT ); Wed, 7 Apr 2021 01:35:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 98CEC613CE; Wed, 7 Apr 2021 05:34:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773694; bh=yzTHByr3GvboIW/T6xufocsK6BWzHcPe3Ttz3XpWwHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q2v8znZRcentw4aDHVudeeDQ/PA3S8rVznRDTSOlpd+Z+N5RX14c8NJkCp6RxqaRX tHlK9Xuu5BXh93xQMg1XF8tfkCxs6WiBjNLBOr/ML8ScWSILeZxioURieZH9XApQuZ zRGEnxLoKQcU/2n6F8/c0HMu3d3pKEB7qKHNND8E= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 06/20] kbuild: scripts/install.sh: handle compressed/uncompressed kernel images Date: Wed, 7 Apr 2021 07:34:05 +0200 Message-Id: <20210407053419.449796-7-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org For x86, the default kernel image is compressed, but other architectures allowed both compressed and uncompressed kernel images to be built. Add a test to detect which one this is, and either name the output file "vmlinuz" for a compressed image, or "vmlinux" for an uncompressed image. For x86 this change is a no-op, but other architectures depend on this. Signed-off-by: Greg Kroah-Hartman --- scripts/install.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 2adcb993efa2..72dc4c81013e 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -49,8 +49,18 @@ verify "$3" if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi -# Default install - same as make zlilo -install "$2" "$4"/vmlinuz +base=$(basename "$2") +if [ "$base" = "bzImage" ]; then + # Compressed install + echo "Installing compressed kernel" + base=vmlinuz +else + # Normal install + echo "Installing normal kernel" + base=vmlinux +fi + +install "$2" "$4"/"$base" install "$3" "$4"/System.map sync From patchwork Wed Apr 7 05:34:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05ACCC433ED for ; Wed, 7 Apr 2021 05:35:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB8D4613CD for ; Wed, 7 Apr 2021 05:35:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348804AbhDGFfa (ORCPT ); Wed, 7 Apr 2021 01:35:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:38858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348785AbhDGFfV (ORCPT ); Wed, 7 Apr 2021 01:35:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1BB7E613CE; Wed, 7 Apr 2021 05:35:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773712; bh=ceCRkUFPQ18/GAzGPcuYnwEBnMTGiXa4tglmN9EQyEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JGy8Sq0s+WIxeUAsWcmLiv4eMjH+0Q7J/MM/NuOMS/Tm4E8WoopeoLQ+SX/a/pkWq xj/JL0qHd0yhUQcyqjroSTIjSFDraftoHtZWoW6aPpeL9lr2IRSrcB15I3xLJ45Yns 3q66iRsPQC8A0VwqF0uGZZbBBAS1G272878xIABM= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 07/20] kbuild: scripts/install.sh: allow for the version number Date: Wed, 7 Apr 2021 07:34:06 +0200 Message-Id: <20210407053419.449796-8-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Some architectures put the version number by default at the end of the files that are copied, so add support for this to be set by arch type. Odds are one day we should change this for x86, but let's not break anyone's systems just yet. Signed-off-by: Greg Kroah-Hartman --- scripts/install.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 72dc4c81013e..934619f81119 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -60,8 +60,19 @@ else base=vmlinux fi -install "$2" "$4"/"$base" -install "$3" "$4"/System.map +# Some architectures name their files based on version number, and +# others do not. Call out the ones that do not to make it obvious. +case "${ARCH}" in + x86) + version="" + ;; + *) + version="-${1}" + ;; +esac + +install "$2" "$4"/"$base""$version" +install "$3" "$4"/System.map"$version" sync # Some architectures like to call specific bootloader "helper" programs: From patchwork Wed Apr 7 05:34:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5941AC433ED for ; Wed, 7 Apr 2021 05:35:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3531E613D3 for ; Wed, 7 Apr 2021 05:35:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348818AbhDGFff (ORCPT ); Wed, 7 Apr 2021 01:35:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:38916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345284AbhDGFfY (ORCPT ); Wed, 7 Apr 2021 01:35:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BD09B613B8; Wed, 7 Apr 2021 05:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773715; bh=1LtG+7DK6bKnBi2fiCGvmOM2s+/3SEL/McsxhTD/qJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FiAjfIrc+lYbxFl7uEMgtFbNoQWG9fQ9+R5YhhD6ILil9yXVjnuxL4vjTRSrdbAN+ P752TFTKp+ls8/yMWH5+MhgMWcch0jJRAkSetV9r8qHUbw+XmMxqJfnTG7CIsfHIyg Zzrl98tHawNoaBMihLWOeOaJj4UFGHJ6hgPWvGJ8= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org Subject: [PATCH 08/20] kbuild: riscv: use common install script Date: Wed, 7 Apr 2021 07:34:07 +0200 Message-Id: <20210407053419.449796-9-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The common scripts/install.sh script will now work for riscv, all that is needed is to add the compressed image type to it. So add that file type check and remove the riscv-only version of the file. Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: linux-riscv@lists.infradead.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Kees Cook --- arch/riscv/boot/Makefile | 4 +-- arch/riscv/boot/install.sh | 60 -------------------------------------- scripts/install.sh | 3 +- 3 files changed, 4 insertions(+), 63 deletions(-) delete mode 100644 arch/riscv/boot/install.sh diff --git a/arch/riscv/boot/Makefile b/arch/riscv/boot/Makefile index 03404c84f971..4ba33aec4ccb 100644 --- a/arch/riscv/boot/Makefile +++ b/arch/riscv/boot/Makefile @@ -47,9 +47,9 @@ $(obj)/loader.bin: $(obj)/loader FORCE $(call if_changed,objcopy) install: - $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ + $(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \ $(obj)/Image System.map "$(INSTALL_PATH)" zinstall: - $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ + $(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \ $(obj)/Image.gz System.map "$(INSTALL_PATH)" diff --git a/arch/riscv/boot/install.sh b/arch/riscv/boot/install.sh deleted file mode 100644 index 18c39159c0ff..000000000000 --- a/arch/riscv/boot/install.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# -# arch/riscv/boot/install.sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# Adapted from code in arch/i386/boot/install.sh by Russell King -# -# "make install" script for the RISC-V Linux port -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -verify () { - if [ ! -f "$1" ]; then - echo "" 1>&2 - echo " *** Missing file: $1" 1>&2 - echo ' *** You need to run "make" before "make install".' 1>&2 - echo "" 1>&2 - exit 1 - fi -} - -# Make sure the files actually exist -verify "$2" -verify "$3" - -# User may have a custom install script -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi - -if [ "$(basename $2)" = "Image.gz" ]; then -# Compressed install - echo "Installing compressed kernel" - base=vmlinuz -else -# Normal install - echo "Installing normal kernel" - base=vmlinux -fi - -if [ -f $4/$base-$1 ]; then - mv $4/$base-$1 $4/$base-$1.old -fi -cat $2 > $4/$base-$1 - -# Install system map file -if [ -f $4/System.map-$1 ]; then - mv $4/System.map-$1 $4/System.map-$1.old -fi -cp $3 $4/System.map-$1 diff --git a/scripts/install.sh b/scripts/install.sh index 934619f81119..9c8a22d96255 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -50,7 +50,8 @@ if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi base=$(basename "$2") -if [ "$base" = "bzImage" ]; then +if [ "$base" = "bzImage" ] || + [ "$base" = "Image.gz" ] ; then # Compressed install echo "Installing compressed kernel" base=vmlinuz From patchwork Wed Apr 7 05:34:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186903 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 944AAC43462 for ; Wed, 7 Apr 2021 05:35:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E759613AF for ; Wed, 7 Apr 2021 05:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348824AbhDGFfg (ORCPT ); Wed, 7 Apr 2021 01:35:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:38958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348793AbhDGFf0 (ORCPT ); Wed, 7 Apr 2021 01:35:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 31FD6613AF; Wed, 7 Apr 2021 05:35:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773717; bh=M0BhCTrtn5EN5sNzgfCPhHAstNgxDh2an+uMVidHxhc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ge5WWcmT9iOVa9uLfkH50Yi3MDQrPmdbm0uhqMqBzcdyOAJd4TiSHyxi1EsgtkL/F FN/DBPAVM+jZMvK4Ilw9O98NjHKmWiiM/6NDudeJcILwKrk+AG1pBeaNTLHGYPoMq8 dSVx7Wrkhvxxn41kIfIOnfwMsCxAH1qQccsLWOTQ= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: [PATCH 09/20] kbuild: arm64: use common install script Date: Wed, 7 Apr 2021 07:34:08 +0200 Message-Id: <20210407053419.449796-10-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The common scripts/install.sh script will now work for arm65, no changes needed so convert the arm64 boot Makefile to call it instead of the arm64-only version of the file and remove the now unused file. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Greg Kroah-Hartman Acked-by: Catalin Marinas Reviewed-by: Kees Cook --- arch/arm64/boot/Makefile | 4 +-- arch/arm64/boot/install.sh | 60 -------------------------------------- 2 files changed, 2 insertions(+), 62 deletions(-) delete mode 100644 arch/arm64/boot/install.sh diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile index cd3414898d10..08c56332dde2 100644 --- a/arch/arm64/boot/Makefile +++ b/arch/arm64/boot/Makefile @@ -37,9 +37,9 @@ $(obj)/Image.lzo: $(obj)/Image FORCE $(call if_changed,lzo) install: - $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ + $(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \ $(obj)/Image System.map "$(INSTALL_PATH)" zinstall: - $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ + $(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \ $(obj)/Image.gz System.map "$(INSTALL_PATH)" diff --git a/arch/arm64/boot/install.sh b/arch/arm64/boot/install.sh deleted file mode 100644 index d91e1f022573..000000000000 --- a/arch/arm64/boot/install.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# -# arch/arm64/boot/install.sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# Adapted from code in arch/i386/boot/install.sh by Russell King -# -# "make install" script for the AArch64 Linux port -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -verify () { - if [ ! -f "$1" ]; then - echo "" 1>&2 - echo " *** Missing file: $1" 1>&2 - echo ' *** You need to run "make" before "make install".' 1>&2 - echo "" 1>&2 - exit 1 - fi -} - -# Make sure the files actually exist -verify "$2" -verify "$3" - -# User may have a custom install script -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi - -if [ "$(basename $2)" = "Image.gz" ]; then -# Compressed install - echo "Installing compressed kernel" - base=vmlinuz -else -# Normal install - echo "Installing normal kernel" - base=vmlinux -fi - -if [ -f $4/$base-$1 ]; then - mv $4/$base-$1 $4/$base-$1.old -fi -cat $2 > $4/$base-$1 - -# Install system map file -if [ -f $4/System.map-$1 ]; then - mv $4/System.map-$1 $4/System.map-$1.old -fi -cp $3 $4/System.map-$1 From patchwork Wed Apr 7 05:34:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186905 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C715C433B4 for ; Wed, 7 Apr 2021 05:35:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48CCC613CF for ; Wed, 7 Apr 2021 05:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348838AbhDGFfl (ORCPT ); Wed, 7 Apr 2021 01:35:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:39024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345328AbhDGFfa (ORCPT ); Wed, 7 Apr 2021 01:35:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9B23C613D2; Wed, 7 Apr 2021 05:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773720; bh=0239ZVpF/A0+KAxcPRCh+JViWwBs7E9YBWSypoFdFGE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KK6F79PilecPNNzW3JoxL/ZfHPwDWHnJyH/G91ybdZ/RdhIng3E/56ZLN2QtAzcV2 2tgQc/r7vPMaGcHn2B2dyFQj19zluQH2qaGdIbTaVoQia73bXrOeRZru4S4BJ+9SdU J/AkzuxD5gi66yBujOlHRaZbwPBT50rbLYarDxHE= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Russell King , linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/20] kbuild: arm: use common install script Date: Wed, 7 Apr 2021 07:34:09 +0200 Message-Id: <20210407053419.449796-11-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The common scripts/install.sh script will now work for arm, all that is needed is to add the compressed image type to it. So add that file type check and the ability to call /sbin/loadmap after copying the kernel. With that we can remove the arm-only version of the file. Cc: Russell King Cc: Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Kees Cook --- arch/arm/boot/Makefile | 6 ++-- arch/arm/boot/install.sh | 66 ---------------------------------------- scripts/install.sh | 10 +++++- 3 files changed, 12 insertions(+), 70 deletions(-) delete mode 100644 arch/arm/boot/install.sh diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index 0b3cd7a33a26..053187f0b714 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile @@ -104,15 +104,15 @@ initrd: (echo You must specify INITRD; exit -1) install: - $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ + $(CONFIG_SHELL) $(srctree)/scripts/install.sh "$(KERNELRELEASE)" \ $(obj)/Image System.map "$(INSTALL_PATH)" zinstall: - $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ + $(CONFIG_SHELL) $(srctree)/scripts/install.sh "$(KERNELRELEASE)" \ $(obj)/zImage System.map "$(INSTALL_PATH)" uinstall: - $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ + $(CONFIG_SHELL) $(srctree)/scripts/install.sh "$(KERNELRELEASE)" \ $(obj)/uImage System.map "$(INSTALL_PATH)" subdir- := bootp compressed dts diff --git a/arch/arm/boot/install.sh b/arch/arm/boot/install.sh deleted file mode 100644 index 2a45092a40e3..000000000000 --- a/arch/arm/boot/install.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -# -# arch/arm/boot/install.sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# Adapted from code in arch/i386/boot/install.sh by Russell King -# -# "make install" script for arm architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -verify () { - if [ ! -f "$1" ]; then - echo "" 1>&2 - echo " *** Missing file: $1" 1>&2 - echo ' *** You need to run "make" before "make install".' 1>&2 - echo "" 1>&2 - exit 1 - fi -} - -# Make sure the files actually exist -verify "$2" -verify "$3" - -# User may have a custom install script -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi - -if [ "$(basename $2)" = "zImage" ]; then -# Compressed install - echo "Installing compressed kernel" - base=vmlinuz -else -# Normal install - echo "Installing normal kernel" - base=vmlinux -fi - -if [ -f $4/$base-$1 ]; then - mv $4/$base-$1 $4/$base-$1.old -fi -cat $2 > $4/$base-$1 - -# Install system map file -if [ -f $4/System.map-$1 ]; then - mv $4/System.map-$1 $4/System.map-$1.old -fi -cp $3 $4/System.map-$1 - -if [ -x /sbin/loadmap ]; then - /sbin/loadmap -else - echo "You have to install it yourself" -fi diff --git a/scripts/install.sh b/scripts/install.sh index 9c8a22d96255..73067b535ea0 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -51,7 +51,8 @@ if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi base=$(basename "$2") if [ "$base" = "bzImage" ] || - [ "$base" = "Image.gz" ] ; then + [ "$base" = "Image.gz" ] || + [ "$base" = "zImage" ] ; then # Compressed install echo "Installing compressed kernel" base=vmlinuz @@ -78,6 +79,13 @@ sync # Some architectures like to call specific bootloader "helper" programs: case "${ARCH}" in + arm) + if [ -x /sbin/loadmap ]; then + /sbin/loadmap + else + echo "You have to install it yourself" + fi + ;; x86) if [ -x /sbin/lilo ]; then /sbin/lilo From patchwork Wed Apr 7 05:34:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186907 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C91B3C43600 for ; Wed, 7 Apr 2021 05:35:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 951D0613E1 for ; Wed, 7 Apr 2021 05:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348840AbhDGFfl (ORCPT ); Wed, 7 Apr 2021 01:35:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:39072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348807AbhDGFfb (ORCPT ); Wed, 7 Apr 2021 01:35:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 24D8F613C0; Wed, 7 Apr 2021 05:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773722; bh=706RqTA/cj2QimpJUjo370sgwIA6WeaG9eDGyf53tO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qD8nz/66Ub0Wcbbu6j6BHvofj3oVvk+f/iV5Y8bkPDIN5LVbT5cZRC9Dv2FQ38ZsR IpBZUbqLWlLCVG7DO6aIkpQ9qKZZ7qLu5pb7Sjnu8bi8l7+c+2pYJmdZxKnXtE4mAG 38iszQTdaJ2SO13Z8eOiOQg5Pc8jjl+ygwAllMI0= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , linux-ia64@vger.kernel.org Subject: [PATCH 11/20] kbuild: ia64: use common install script Date: Wed, 7 Apr 2021 07:34:10 +0200 Message-Id: <20210407053419.449796-12-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The common scripts/install.sh script will now work for ia64, all that is needed is to add the compressed image type to it. So add that file type check and the ability to call /usr/sbin/elilo after copying the kernel. With that we can remove the ia64-only version of the file. Cc: linux-ia64@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Sergei Trofimovich Reviewed-by: Kees Cook --- arch/ia64/Makefile | 2 +- arch/ia64/install.sh | 40 ---------------------------------------- scripts/install.sh | 8 +++++++- 3 files changed, 8 insertions(+), 42 deletions(-) delete mode 100644 arch/ia64/install.sh diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index 467b7e7f967c..19e20e99f487 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile @@ -77,7 +77,7 @@ archheaders: CLEAN_FILES += vmlinux.gz install: vmlinux.gz - sh $(srctree)/arch/ia64/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)" + sh $(srctree)/scripts/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)" define archhelp echo '* compressed - Build compressed kernel image' diff --git a/arch/ia64/install.sh b/arch/ia64/install.sh deleted file mode 100644 index 0e932f5dcd1a..000000000000 --- a/arch/ia64/install.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# arch/ia64/install.sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# -# "make install" script for ia64 architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -# User may have a custom install script - -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi - -# Default install - same as make zlilo - -if [ -f $4/vmlinuz ]; then - mv $4/vmlinuz $4/vmlinuz.old -fi - -if [ -f $4/System.map ]; then - mv $4/System.map $4/System.old -fi - -cat $2 > $4/vmlinuz -cp $3 $4/System.map - -test -x /usr/sbin/elilo && /usr/sbin/elilo diff --git a/scripts/install.sh b/scripts/install.sh index 73067b535ea0..b6ca2a0f0983 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -52,6 +52,7 @@ if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi base=$(basename "$2") if [ "$base" = "bzImage" ] || [ "$base" = "Image.gz" ] || + [ "$base" = "vmlinux.gz" ] || [ "$base" = "zImage" ] ; then # Compressed install echo "Installing compressed kernel" @@ -65,7 +66,7 @@ fi # Some architectures name their files based on version number, and # others do not. Call out the ones that do not to make it obvious. case "${ARCH}" in - x86) + ia64 | x86) version="" ;; *) @@ -86,6 +87,11 @@ case "${ARCH}" in echo "You have to install it yourself" fi ;; + ia64) + if [ -x /usr/sbin/elilo ]; then + /usr/sbin/elilo + fi + ;; x86) if [ -x /sbin/lilo ]; then /sbin/lilo From patchwork Wed Apr 7 05:34:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186909 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 296FEC43461 for ; Wed, 7 Apr 2021 05:35:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01717613CE for ; Wed, 7 Apr 2021 05:35:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345275AbhDGFfs (ORCPT ); Wed, 7 Apr 2021 01:35:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:39130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348791AbhDGFff (ORCPT ); Wed, 7 Apr 2021 01:35:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F532613CC; Wed, 7 Apr 2021 05:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773725; bh=ouCNsuEblkJkqcCKpXydk5fFIdkMGlk7rAG0PrWREyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zl6se3MSZf7Bbx6lGPOwhll9RDskOF1e5A+NfZEmyM9Pa92fItZ6qdjg8m7qhgbDG GjAsElIQZddmy/qiOKqfn/pjBBNKYEAq0nbLX3H3FMfTJrmb8C0/1I+DPbnmPwKNrr Af0UHuIf1mo/sCxNU0Spbzn9Hl+qvffg/I5KuYRI= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org Subject: [PATCH 12/20] kbuild: m68k: use common install script Date: Wed, 7 Apr 2021 07:34:11 +0200 Message-Id: <20210407053419.449796-13-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The common scripts/install.sh script will now work for m68k, all that is needed is to add it to the list of arches that do not put the version number in the installed file name. With that we can remove the m68k-only version of the install script. Cc: Geert Uytterhoeven Cc: linux-m68k@lists.linux-m68k.org Signed-off-by: Greg Kroah-Hartman Acked-by: Geert Uytterhoeven Reviewed-by: Kees Cook --- arch/m68k/Makefile | 2 +- arch/m68k/install.sh | 52 -------------------------------------------- scripts/install.sh | 2 +- 3 files changed, 2 insertions(+), 54 deletions(-) delete mode 100644 arch/m68k/install.sh diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile index ea14f2046fb4..e56abf79c313 100644 --- a/arch/m68k/Makefile +++ b/arch/m68k/Makefile @@ -143,4 +143,4 @@ archheaders: $(Q)$(MAKE) $(build)=arch/m68k/kernel/syscalls all install: - sh $(srctree)/arch/m68k/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)" + sh $(srctree)/scripts/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)" diff --git a/arch/m68k/install.sh b/arch/m68k/install.sh deleted file mode 100644 index 57d640d4382c..000000000000 --- a/arch/m68k/install.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# -# "make install" script for m68k architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -verify () { - if [ ! -f "$1" ]; then - echo "" 1>&2 - echo " *** Missing file: $1" 1>&2 - echo ' *** You need to run "make" before "make install".' 1>&2 - echo "" 1>&2 - exit 1 - fi -} - -# Make sure the files actually exist -verify "$2" -verify "$3" - -# User may have a custom install script - -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi - -# Default install - same as make zlilo - -if [ -f $4/vmlinuz ]; then - mv $4/vmlinuz $4/vmlinuz.old -fi - -if [ -f $4/System.map ]; then - mv $4/System.map $4/System.old -fi - -cat $2 > $4/vmlinuz -cp $3 $4/System.map - -sync diff --git a/scripts/install.sh b/scripts/install.sh index b6ca2a0f0983..a61a5ce28cad 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -66,7 +66,7 @@ fi # Some architectures name their files based on version number, and # others do not. Call out the ones that do not to make it obvious. case "${ARCH}" in - ia64 | x86) + ia64 | m68k | x86) version="" ;; *) From patchwork Wed Apr 7 05:34:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186911 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0249C43460 for ; Wed, 7 Apr 2021 05:35:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83697613B8 for ; Wed, 7 Apr 2021 05:35:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348811AbhDGFfv (ORCPT ); Wed, 7 Apr 2021 01:35:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:38958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348829AbhDGFfh (ORCPT ); Wed, 7 Apr 2021 01:35:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 416E7613B8; Wed, 7 Apr 2021 05:35:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773727; bh=gUfBIHZtK9czx4c8L8i0ymGf3DhRbtRfeKd479UX8fw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ibLV/n5vAHDZRJvDQHX7RgLM4ew5c/ZrSO1wzDqbuZphb3nI33/j7EPJC4xyFEVN+ DUPfUM49m8h5XewWYBhtt0LrZacAnaFAoKekLUMkyNlz4TS63H09TIS2FjhJItprDo CK1WFmX6h1jXjVzC0z0rNw/hBNZOQzt1koQdF4kA= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Nick Hu , Greentime Hu , Vincent Chen Subject: [PATCH 13/20] kbuild: nds32: convert to use the common install scripts Date: Wed, 7 Apr 2021 07:34:12 +0200 Message-Id: <20210407053419.449796-14-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org It seems that no one ever checked in the nds32 install script so trying to build a nds32 kernel would never quite work properly as 'make install' would fail to run. Fix that up by having nds32 call the common install.sh script. Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen Signed-off-by: Greg Kroah-Hartman --- arch/nds32/boot/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/nds32/boot/Makefile b/arch/nds32/boot/Makefile index c4cc0c2689f7..8371e02f6091 100644 --- a/arch/nds32/boot/Makefile +++ b/arch/nds32/boot/Makefile @@ -8,9 +8,9 @@ $(obj)/Image.gz: $(obj)/Image FORCE $(call if_changed,gzip) install: $(obj)/Image - $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ + $(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \ $(obj)/Image System.map "$(INSTALL_PATH)" zinstall: $(obj)/Image.gz - $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ + $(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \ $(obj)/Image.gz System.map "$(INSTALL_PATH)" From patchwork Wed Apr 7 05:34:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186913 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F85FC43461 for ; Wed, 7 Apr 2021 05:35:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A877613CD for ; Wed, 7 Apr 2021 05:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242365AbhDGFf4 (ORCPT ); Wed, 7 Apr 2021 01:35:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:39246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345265AbhDGFfj (ORCPT ); Wed, 7 Apr 2021 01:35:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CAD0F613CD; Wed, 7 Apr 2021 05:35:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773730; bh=gVgUNc4TLYn8Vpa0TphdO6IywdJAqWVWW8gaDGaAvFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kgm3lRqrWR6kDKh5cwFqnqt2fHOTTVTosrukRIUQ6AHTp4d2rcFu306xtK+MEAy2S GsDyKRsr/7P96nw4qEzXSv+QvjNIk351RfrQZTBK6Pghf8xgcCtVW6URGqjeeeX2IZ jvPiDclZyN5PAKihoixSBwluV18VhO6eYcEPEeHU= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Ley Foon Tan Subject: [PATCH 14/20] kbuild: nios2: use common install script Date: Wed, 7 Apr 2021 07:34:13 +0200 Message-Id: <20210407053419.449796-15-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The common scripts/install.sh script will now work for nios2, all that is needed is to add it to the list of arches that do not put the version number in the installed file name. With that we can remove the nios2-only version of the install script. Cc: Ley Foon Tan Signed-off-by: Greg Kroah-Hartman Reviewed-by: Kees Cook --- arch/nios2/boot/Makefile | 2 +- arch/nios2/boot/install.sh | 52 -------------------------------------- scripts/install.sh | 2 +- 3 files changed, 2 insertions(+), 54 deletions(-) delete mode 100644 arch/nios2/boot/install.sh diff --git a/arch/nios2/boot/Makefile b/arch/nios2/boot/Makefile index 37dfc7e584bc..b8d8a3be156a 100644 --- a/arch/nios2/boot/Makefile +++ b/arch/nios2/boot/Makefile @@ -32,4 +32,4 @@ $(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE $(Q)$(MAKE) $(build)=$(obj)/compressed $@ install: - sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" + sh $(srctree)/scripts/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" diff --git a/arch/nios2/boot/install.sh b/arch/nios2/boot/install.sh deleted file mode 100644 index 3cb3f468bc51..000000000000 --- a/arch/nios2/boot/install.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# -# "make install" script for nios2 architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -verify () { - if [ ! -f "$1" ]; then - echo "" 1>&2 - echo " *** Missing file: $1" 1>&2 - echo ' *** You need to run "make" before "make install".' 1>&2 - echo "" 1>&2 - exit 1 - fi -} - -# Make sure the files actually exist -verify "$2" -verify "$3" - -# User may have a custom install script - -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi - -# Default install - same as make zlilo - -if [ -f $4/vmlinuz ]; then - mv $4/vmlinuz $4/vmlinuz.old -fi - -if [ -f $4/System.map ]; then - mv $4/System.map $4/System.old -fi - -cat $2 > $4/vmlinuz -cp $3 $4/System.map - -sync diff --git a/scripts/install.sh b/scripts/install.sh index a61a5ce28cad..407ffa65062c 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -66,7 +66,7 @@ fi # Some architectures name their files based on version number, and # others do not. Call out the ones that do not to make it obvious. case "${ARCH}" in - ia64 | m68k | x86) + ia64 | m68k | nios2 | x86) version="" ;; *) From patchwork Wed Apr 7 05:34:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186887 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BC91C433ED for ; Wed, 7 Apr 2021 05:34:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4285A613AF for ; Wed, 7 Apr 2021 05:34:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348740AbhDGFfG (ORCPT ); Wed, 7 Apr 2021 01:35:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:38444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348735AbhDGFfF (ORCPT ); Wed, 7 Apr 2021 01:35:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CA765613C0; Wed, 7 Apr 2021 05:34:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773696; bh=uMP12yNGVObvgWoR/JQ2SMvn/xmE14YMI6OCZDUEt6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k+kNCQEr8yxoXksUAGeIg0cHAcz58x0yHwYpeE215KR+xLyQrlubB5SdoZhBEI4wF pujGtCniuFqLvEs6MGZs79LcD/bn8rDgleSYIcWsnbIut0GzxUucX2m8P3a5Zbzn7N tdoHchZFpyC0OEcJG5c+wrTUGJO85+aqpkOJwEwk= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org Subject: [PATCH 15/20] kbuild: parisc: use common install script Date: Wed, 7 Apr 2021 07:34:14 +0200 Message-Id: <20210407053419.449796-16-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The common scripts/install.sh script will now work for parisc, all that is needed is to add the compressed image type to it. So add that file type check, and then we can remove the two different copies of the parisc install.sh script that were only different by one line and have the arch call the common install script. Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/parisc/Makefile | 4 +-- arch/parisc/boot/Makefile | 2 +- arch/parisc/boot/install.sh | 65 ------------------------------------ arch/parisc/install.sh | 66 ------------------------------------- scripts/install.sh | 1 + 5 files changed, 4 insertions(+), 134 deletions(-) delete mode 100644 arch/parisc/boot/install.sh delete mode 100644 arch/parisc/install.sh diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index 7d9f71aa829a..296d8ab8e2aa 100644 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile @@ -164,10 +164,10 @@ vmlinuz: vmlinux endif install: - $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \ + $(CONFIG_SHELL) $(srctree)/scripts/install.sh \ $(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)" zinstall: - $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \ + $(CONFIG_SHELL) $(srctree)/scripts/install.sh \ $(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)" CLEAN_FILES += lifimage diff --git a/arch/parisc/boot/Makefile b/arch/parisc/boot/Makefile index 61f44142cfe1..ad2611929aee 100644 --- a/arch/parisc/boot/Makefile +++ b/arch/parisc/boot/Makefile @@ -17,5 +17,5 @@ $(obj)/compressed/vmlinux: FORCE $(Q)$(MAKE) $(build)=$(obj)/compressed $@ install: $(CONFIGURE) $(obj)/bzImage - sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \ + sh -x $(srctree)/scripts/install.sh $(KERNELRELEASE) $(obj)/bzImage \ System.map "$(INSTALL_PATH)" diff --git a/arch/parisc/boot/install.sh b/arch/parisc/boot/install.sh deleted file mode 100644 index 8f7c365fad83..000000000000 --- a/arch/parisc/boot/install.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# -# arch/parisc/install.sh, derived from arch/i386/boot/install.sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# -# "make install" script for i386 architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -verify () { - if [ ! -f "$1" ]; then - echo "" 1>&2 - echo " *** Missing file: $1" 1>&2 - echo ' *** You need to run "make" before "make install".' 1>&2 - echo "" 1>&2 - exit 1 - fi -} - -# Make sure the files actually exist - -verify "$2" -verify "$3" - -# User may have a custom install script - -if [ -n "${INSTALLKERNEL}" ]; then - if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi - if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi -fi - -# Default install - -if [ "$(basename $2)" = "zImage" ]; then -# Compressed install - echo "Installing compressed kernel" - base=vmlinuz -else -# Normal install - echo "Installing normal kernel" - base=vmlinux -fi - -if [ -f $4/$base-$1 ]; then - mv $4/$base-$1 $4/$base-$1.old -fi -cat $2 > $4/$base-$1 - -# Install system map file -if [ -f $4/System.map-$1 ]; then - mv $4/System.map-$1 $4/System.map-$1.old -fi -cp $3 $4/System.map-$1 diff --git a/arch/parisc/install.sh b/arch/parisc/install.sh deleted file mode 100644 index 056d588befdd..000000000000 --- a/arch/parisc/install.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -# -# arch/parisc/install.sh, derived from arch/i386/boot/install.sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# -# "make install" script for i386 architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -verify () { - if [ ! -f "$1" ]; then - echo "" 1>&2 - echo " *** Missing file: $1" 1>&2 - echo ' *** You need to run "make" before "make install".' 1>&2 - echo "" 1>&2 - exit 1 - fi -} - -# Make sure the files actually exist - -verify "$2" -verify "$3" - -# User may have a custom install script - -if [ -n "${INSTALLKERNEL}" ]; then - if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi - if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi -fi - -# Default install - -if [ "$(basename $2)" = "vmlinuz" ]; then -# Compressed install - echo "Installing compressed kernel" - base=vmlinuz -else -# Normal install - echo "Installing normal kernel" - base=vmlinux -fi - -if [ -f $4/$base-$1 ]; then - mv $4/$base-$1 $4/$base-$1.old -fi -cat $2 > $4/$base-$1 - -# Install system map file -if [ -f $4/System.map-$1 ]; then - mv $4/System.map-$1 $4/System.map-$1.old -fi -cp $3 $4/System.map-$1 - diff --git a/scripts/install.sh b/scripts/install.sh index 407ffa65062c..e0ffb95737d4 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -53,6 +53,7 @@ base=$(basename "$2") if [ "$base" = "bzImage" ] || [ "$base" = "Image.gz" ] || [ "$base" = "vmlinux.gz" ] || + [ "$base" = "vmlinuz" ] || [ "$base" = "zImage" ] ; then # Compressed install echo "Installing compressed kernel" From patchwork Wed Apr 7 05:34:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 245B5C433ED for ; Wed, 7 Apr 2021 05:35:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 033DB613CD for ; Wed, 7 Apr 2021 05:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348735AbhDGFfL (ORCPT ); Wed, 7 Apr 2021 01:35:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:38540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348757AbhDGFfI (ORCPT ); Wed, 7 Apr 2021 01:35:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5097B613CE; Wed, 7 Apr 2021 05:34:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773698; bh=0om60PPyB8AjfB1ITSmbocahrr+Wf0G845qHknWIX6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C4jtnY4z2HLxWTcOOcTN6W4MiZyMAdia1o5HKoroUK2ACGE4CbbU/79glOZ/1jUVI rnXUZdQAB42ebhhn1gXsAA/XlkBJLoZ+P2Pe3X/2SqXzH8lyX/jzgJkpk2HKsUjWrZ 1bpI49yIdPP34X/f8lbP9Anjpv6MvDiZuBBfX8o0= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Michael Ellerman , linuxppc-dev@lists.ozlabs.org Subject: [PATCH 16/20] kbuild: powerpc: use common install script Date: Wed, 7 Apr 2021 07:34:15 +0200 Message-Id: <20210407053419.449796-17-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The common scripts/install.sh script will now work for powerpc, all that is needed is to add it to the list of arches that do not put the version number in the installed file name. After the kernel is installed, powerpc also likes to install a few random files, so provide the ability to do that as well. With that we can remove the powerpc-only version of the install script. Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/boot/Makefile | 4 +-- arch/powerpc/boot/install.sh | 55 ------------------------------------ scripts/install.sh | 14 ++++++++- 3 files changed, 15 insertions(+), 58 deletions(-) delete mode 100644 arch/powerpc/boot/install.sh diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 2b8da923ceca..bbfcbd33e0b7 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -442,11 +442,11 @@ $(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y)) # Only install the vmlinux install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y)) - sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" + sh -x $(srctree)/scripts/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" # Install the vmlinux and other built boot targets. zInstall: $(CONFIGURE) $(addprefix $(obj)/, $(image-y)) - sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^ + sh -x $(srctree)/scripts/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^ PHONY += install zInstall diff --git a/arch/powerpc/boot/install.sh b/arch/powerpc/boot/install.sh deleted file mode 100644 index b6a256bc96ee..000000000000 --- a/arch/powerpc/boot/install.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Blatantly stolen from in arch/i386/boot/install.sh by Dave Hansen -# -# "make install" script for ppc64 architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc. -# - -# Bail with error code if anything goes wrong -set -e - -# User may have a custom install script - -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi - -# Default install - -# this should work for both the pSeries zImage and the iSeries vmlinux.sm -image_name=`basename $2` - -if [ -f $4/$image_name ]; then - mv $4/$image_name $4/$image_name.old -fi - -if [ -f $4/System.map ]; then - mv $4/System.map $4/System.old -fi - -cat $2 > $4/$image_name -cp $3 $4/System.map - -# Copy all the bootable image files -path=$4 -shift 4 -while [ $# -ne 0 ]; do - image_name=`basename $1` - if [ -f $path/$image_name ]; then - mv $path/$image_name $path/$image_name.old - fi - cat $1 > $path/$image_name - shift -done; diff --git a/scripts/install.sh b/scripts/install.sh index e0ffb95737d4..67c0a5f74af2 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -67,7 +67,7 @@ fi # Some architectures name their files based on version number, and # others do not. Call out the ones that do not to make it obvious. case "${ARCH}" in - ia64 | m68k | nios2 | x86) + ia64 | m68k | nios2 | powerpc | x86) version="" ;; *) @@ -93,6 +93,18 @@ case "${ARCH}" in /usr/sbin/elilo fi ;; + powerpc) + # powerpc installation can list other boot targets after the + # install path that should be copied to the correct location + path=$4 + shift 4 + while [ $# -ne 0 ]; do + image_name=$(basename "$1") + install "$1" "$path"/"$image_name" + shift + done; + sync + ;; x86) if [ -x /sbin/lilo ]; then /sbin/lilo From patchwork Wed Apr 7 05:34:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C82CDC433B4 for ; Wed, 7 Apr 2021 05:35:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 90AB1613CE for ; Wed, 7 Apr 2021 05:35:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345281AbhDGFfO (ORCPT ); Wed, 7 Apr 2021 01:35:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:38642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348763AbhDGFfM (ORCPT ); Wed, 7 Apr 2021 01:35:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D4A32613AF; Wed, 7 Apr 2021 05:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773702; bh=FZFEMVhO0nItcH9QpwU17LByF5JS6aB8jEDu4fnSwk4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TEVuE4W+UF5AV7oHDtC8vvLkNb9vSr9dp6VnJBxyyFoQciAY3G8LU0sa8ZaiLDPDs G4ZZ2+H1i9vQTQ5i772Wx/ryExcrVJRN3xp7qzOb5MsfoI0aEuSII+1X3mhFzhw0qi Z/CWyv9xMFWtgWQzLAm3QWXOWxCHvBxN8f/yd4lI= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org Subject: [PATCH 17/20] kbuild: s390: use common install script Date: Wed, 7 Apr 2021 07:34:16 +0200 Message-Id: <20210407053419.449796-18-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The common scripts/install.sh script will now work for s390, no changes needed. So call that instead and delete the s390-only install script. Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Acked-by: Heiko Carstens Reviewed-by: Kees Cook --- arch/s390/boot/Makefile | 2 +- arch/s390/boot/install.sh | 30 ------------------------------ 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 arch/s390/boot/install.sh diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile index 41a64b8dce25..5e3058d6e59b 100644 --- a/arch/s390/boot/Makefile +++ b/arch/s390/boot/Makefile @@ -71,5 +71,5 @@ $(obj)/startup.a: $(OBJECTS) FORCE $(call if_changed,ar) install: - sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \ + sh -x $(srctree)/scripts/install.sh $(KERNELRELEASE) $(obj)/bzImage \ System.map "$(INSTALL_PATH)" diff --git a/arch/s390/boot/install.sh b/arch/s390/boot/install.sh deleted file mode 100644 index 515b27a996b3..000000000000 --- a/arch/s390/boot/install.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# -# arch/s390x/boot/install.sh -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# -# "make install" script for s390 architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -# User may have a custom install script - -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi - -echo "Warning: '${INSTALLKERNEL}' command not available - additional " \ - "bootloader config required" >&2 -if [ -f $4/vmlinuz-$1 ]; then mv $4/vmlinuz-$1 $4/vmlinuz-$1.old; fi -if [ -f $4/System.map-$1 ]; then mv $4/System.map-$1 $4/System.map-$1.old; fi - -cat $2 > $4/vmlinuz-$1 -cp $3 $4/System.map-$1 From patchwork Wed Apr 7 05:34:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39705C43461 for ; Wed, 7 Apr 2021 05:35:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 15C0C613C0 for ; Wed, 7 Apr 2021 05:35:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348774AbhDGFfP (ORCPT ); Wed, 7 Apr 2021 01:35:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:38704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348750AbhDGFfN (ORCPT ); Wed, 7 Apr 2021 01:35:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1F57B613C0; Wed, 7 Apr 2021 05:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773704; bh=eVXzx4Wqy4ji8M24EPqvJ+83p5xmN0OGX+WMwvF+Xus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gWUFj7rmHM99R1uuvzEz3HOmAKl5WQb3SLjgCNvi93Sqr6coXL/Z7VEK+kPC4grg+ 9BghTnGAo4S4m0cZBmecxuvXfcE0yktJiEmZ4AZkPK0darn/wXWD39THsjMOPEQwo7 oMdoAz1EGWOdVrOmTqNnDriTCc7xFpZDXgQYTjFE= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: [PATCH 18/20] kbuild: sh: remove unused install script Date: Wed, 7 Apr 2021 07:34:17 +0200 Message-Id: <20210407053419.449796-19-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The sh arch has a install.sh script, but no Makefile actually calls it. Remove it to keep anyone from accidentally calling it in the future. Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Kees Cook --- arch/sh/boot/compressed/install.sh | 56 ------------------------------ 1 file changed, 56 deletions(-) delete mode 100644 arch/sh/boot/compressed/install.sh diff --git a/arch/sh/boot/compressed/install.sh b/arch/sh/boot/compressed/install.sh deleted file mode 100644 index f9f41818b17e..000000000000 --- a/arch/sh/boot/compressed/install.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# -# arch/sh/boot/install.sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# Adapted from code in arch/i386/boot/install.sh by Russell King -# Adapted from code in arch/arm/boot/install.sh by Stuart Menefy -# -# "make install" script for sh architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -# User may have a custom install script - -if [ -x /sbin/${INSTALLKERNEL} ]; then - exec /sbin/${INSTALLKERNEL} "$@" -fi - -if [ "$2" = "zImage" ]; then -# Compressed install - echo "Installing compressed kernel" - if [ -f $4/vmlinuz-$1 ]; then - mv $4/vmlinuz-$1 $4/vmlinuz.old - fi - - if [ -f $4/System.map-$1 ]; then - mv $4/System.map-$1 $4/System.old - fi - - cat $2 > $4/vmlinuz-$1 - cp $3 $4/System.map-$1 -else -# Normal install - echo "Installing normal kernel" - if [ -f $4/vmlinux-$1 ]; then - mv $4/vmlinux-$1 $4/vmlinux.old - fi - - if [ -f $4/System.map ]; then - mv $4/System.map $4/System.old - fi - - cat $2 > $4/vmlinux-$1 - cp $3 $4/System.map -fi From patchwork Wed Apr 7 05:34:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F61FC43461 for ; Wed, 7 Apr 2021 05:35:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E307613CD for ; Wed, 7 Apr 2021 05:35:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348750AbhDGFfZ (ORCPT ); Wed, 7 Apr 2021 01:35:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:38762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348781AbhDGFfQ (ORCPT ); Wed, 7 Apr 2021 01:35:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BFBBB613CD; Wed, 7 Apr 2021 05:35:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773707; bh=uMG/cQRFUC9+CiAgPW7FU6n8MPg87Dm5ua+Jwmm6WYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZlwIWx3BIdtOtnYiA1p8yWZWvoPQEghJXqRP2JQKxUI/OF6UCCJP6MiYTe/TxvjzT eNB1gk9ja2C7kL4id3Oof1ETOCNFQJcjP5aSareWcq6dRwxzD/tjzOOWXBTozxaLxC HyjTynB5PghiAbL+DTWfDGCNLCyxqb+VzwOZTq3Q= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "David S. Miller" , sparclinux@vger.kernel.org Subject: [PATCH 19/20] kbuild: sparc: use common install script Date: Wed, 7 Apr 2021 07:34:18 +0200 Message-Id: <20210407053419.449796-20-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The common scripts/install.sh script will now work for sparc, all that is needed is to add it to the list of arches that do not put the version number in the installed file name. With that we can remove the sparc-only version of the install script. Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Kees Cook --- arch/sparc/boot/Makefile | 2 +- arch/sparc/boot/install.sh | 50 -------------------------------------- scripts/install.sh | 2 +- 3 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 arch/sparc/boot/install.sh diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile index 380e2b018992..952f8e7a40ec 100644 --- a/arch/sparc/boot/Makefile +++ b/arch/sparc/boot/Makefile @@ -72,5 +72,5 @@ $(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback System.map $(ROOT_IMG) FORCE $(call if_changed,piggy) install: - sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/zImage \ + sh $(srctree)/scripts/install.sh $(KERNELRELEASE) $(obj)/zImage \ System.map "$(INSTALL_PATH)" diff --git a/arch/sparc/boot/install.sh b/arch/sparc/boot/install.sh deleted file mode 100644 index b32851eae693..000000000000 --- a/arch/sparc/boot/install.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# -# "make install" script for SPARC architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -verify () { - if [ ! -f "$1" ]; then - echo "" 1>&2 - echo " *** Missing file: $1" 1>&2 - echo ' *** You need to run "make" before "make install".' 1>&2 - echo "" 1>&2 - exit 1 - fi -} - -# Make sure the files actually exist -verify "$2" -verify "$3" - -# User may have a custom install script - -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi - -# Default install - same as make zlilo - -if [ -f $4/vmlinuz ]; then - mv $4/vmlinuz $4/vmlinuz.old -fi - -if [ -f $4/System.map ]; then - mv $4/System.map $4/System.old -fi - -cat $2 > $4/vmlinuz -cp $3 $4/System.map diff --git a/scripts/install.sh b/scripts/install.sh index 67c0a5f74af2..225b19bbbfa6 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -67,7 +67,7 @@ fi # Some architectures name their files based on version number, and # others do not. Call out the ones that do not to make it obvious. case "${ARCH}" in - ia64 | m68k | nios2 | powerpc | x86) + ia64 | m68k | nios2 | powerpc | sparc | x86) version="" ;; *) From patchwork Wed Apr 7 05:34:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12186897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6107C433B4 for ; Wed, 7 Apr 2021 05:35:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5A00613D0 for ; Wed, 7 Apr 2021 05:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348797AbhDGFf2 (ORCPT ); Wed, 7 Apr 2021 01:35:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:38798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348757AbhDGFfT (ORCPT ); Wed, 7 Apr 2021 01:35:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4DCB6613C0; Wed, 7 Apr 2021 05:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617773709; bh=+2kUjGkzbI5+Kennc9nY5XrJqaqBq+yhZja8ot+rX3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RNjbROUKzokuePIzkZLKjJjZgnek8DXYozjChnyIdwLjredFdJWJvjctBU57PgLTE KbVSo/aqi8SMFPQveQY8WM7iy89PCbX5bCLJVf8rZgACGVmOnLadcjRwu+eL+PZWoA 50r1Asrc7FFQ9xJz33IPgbomDvdokjNTcofFSCEk= From: Greg Kroah-Hartman To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 20/20] kbuild: scripts/install.sh: update documentation Date: Wed, 7 Apr 2021 07:34:19 +0200 Message-Id: <20210407053419.449796-21-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407053419.449796-1-gregkh@linuxfoundation.org> References: <20210407053419.449796-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Add a proper SPDX line and document the install.sh file a lot better, explaining exactly what it does, and update the copyright notice and provide a better message about the lack of LILO being present or not as really, no one should be using that anymore... Signed-off-by: Greg Kroah-Hartman --- scripts/install.sh | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 225b19bbbfa6..dd86fb9971e9 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,14 +1,14 @@ #!/bin/sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. +# SPDX-License-Identifier: GPL-2.0 # # Copyright (C) 1995 by Linus Torvalds +# Copyright (C) 2021 Greg Kroah-Hartman # # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin +# Adapted from code in arch/i386/boot/install.sh by Russell King +# Adapted from code in arch/arm/boot/install.sh by Stuart Menefy # -# "make install" script for i386 architecture +# "make install" script for Linux to be used by all architectures. # # Arguments: # $1 - kernel version @@ -16,6 +16,26 @@ # $3 - kernel map file # $4 - default install path (blank if root directory) # +# Installs the built kernel image and map and symbol file in the specified +# install location. If no install path is selected, the files will be placed +# in the root directory. +# +# The name of the kernel image will be "vmlinux-VERSION" for uncompressed +# kernels or "vmlinuz-VERSION' for compressed kernels. +# +# The kernel map file will be named "System.map-VERSION" +# +# Note, not all architectures seem to like putting the VERSION number in the +# file name, see below in the script for a list of those that do not. For +# those that do not the "-VERSION" will not be present in the file name. +# +# If there is currently a kernel image or kernel map file present with the name +# of the file to be copied to the location, it will be renamed to contain a +# ".old" suffix. +# +# If ~/bin/${INSTALLKERNEL} or /sbin/${INSTALLKERNEL} is executable, execution +# will be passed to that program instead of this one to allow for distro or +# system specific installation scripts to be used. verify () { if [ ! -f "$1" ]; then @@ -45,7 +65,6 @@ verify "$2" verify "$3" # User may have a custom install script - if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi @@ -111,7 +130,7 @@ case "${ARCH}" in elif [ -x /etc/lilo/install ]; then /etc/lilo/install else - echo "Cannot find LILO." + echo "Cannot find LILO, ensure your bootloader knows of the new kernel image." fi ;; esac