All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: Add install target to Makefile.
@ 2018-02-20  0:04 Shea Levy
  2018-02-20 16:03 ` [PATCH v2] " Shea Levy
  0 siblings, 1 reply; 3+ messages in thread
From: Shea Levy @ 2018-02-20  0:04 UTC (permalink / raw)
  To: linux-riscv

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/riscv/Makefile   |  4 ++++
 arch/riscv/install.sh | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 arch/riscv/install.sh

diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 6719dd30ec5b..26892daefa05 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -70,3 +70,7 @@ core-y += arch/riscv/kernel/ arch/riscv/mm/
 libs-y += arch/riscv/lib/
 
 all: vmlinux
+
+PHONY += install
+install: vmlinux
+	sh $(srctree)/arch/riscv/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
diff --git a/arch/riscv/install.sh b/arch/riscv/install.sh
new file mode 100644
index 000000000000..8b3155a11a4a
--- /dev/null
+++ b/arch/riscv/install.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# arch/riscv/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/ia64/Makefile by Shea Levy
+#
+# "make install" script for riscv 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 - no bootloader configuration (yet?)
+base=$(basename $2)
+
+if [ -f $4/$base ]; then
+	mv $4/$base $4/$base.old
+fi
+
+if [ -f $4/System.map ]; then
+	mv $4/System.map $4/System.old
+fi
+
+cat $2 > $4/$base
+cp $3 $4/System.map
-- 
2.16.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] riscv: Add install target to Makefile.
  2018-02-20  0:04 [PATCH] riscv: Add install target to Makefile Shea Levy
@ 2018-02-20 16:03 ` Shea Levy
  2018-02-24  0:40   ` Palmer Dabbelt
  0 siblings, 1 reply; 3+ messages in thread
From: Shea Levy @ 2018-02-20 16:03 UTC (permalink / raw)
  To: linux-riscv

v2: Fix copy-paste error in comment.

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/riscv/Makefile   |  4 ++++
 arch/riscv/install.sh | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 arch/riscv/install.sh

diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 6719dd30ec5b..26892daefa05 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -70,3 +70,7 @@ core-y += arch/riscv/kernel/ arch/riscv/mm/
 libs-y += arch/riscv/lib/
 
 all: vmlinux
+
+PHONY += install
+install: vmlinux
+	sh $(srctree)/arch/riscv/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
diff --git a/arch/riscv/install.sh b/arch/riscv/install.sh
new file mode 100644
index 000000000000..b98c1db899f1
--- /dev/null
+++ b/arch/riscv/install.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# arch/riscv/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/ia64/install.sh by Shea Levy
+#
+# "make install" script for riscv 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 - no bootloader configuration (yet?)
+base=$(basename $2)
+
+if [ -f $4/$base ]; then
+	mv $4/$base $4/$base.old
+fi
+
+if [ -f $4/System.map ]; then
+	mv $4/System.map $4/System.old
+fi
+
+cat $2 > $4/$base
+cp $3 $4/System.map
-- 
2.16.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] riscv: Add install target to Makefile.
  2018-02-20 16:03 ` [PATCH v2] " Shea Levy
@ 2018-02-24  0:40   ` Palmer Dabbelt
  0 siblings, 0 replies; 3+ messages in thread
From: Palmer Dabbelt @ 2018-02-24  0:40 UTC (permalink / raw)
  To: linux-riscv

On Tue, 20 Feb 2018 08:03:38 PST (-0800), shea at shealevy.com wrote:
> v2: Fix copy-paste error in comment.
>
> Signed-off-by: Shea Levy <shea@shealevy.com>
> ---
>  arch/riscv/Makefile   |  4 ++++
>  arch/riscv/install.sh | 39 +++++++++++++++++++++++++++++++++++++++
>  2 files changed, 43 insertions(+)
>  create mode 100644 arch/riscv/install.sh
>
> diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
> index 6719dd30ec5b..26892daefa05 100644
> --- a/arch/riscv/Makefile
> +++ b/arch/riscv/Makefile
> @@ -70,3 +70,7 @@ core-y += arch/riscv/kernel/ arch/riscv/mm/
>  libs-y += arch/riscv/lib/
>
>  all: vmlinux
> +
> +PHONY += install
> +install: vmlinux
> +	sh $(srctree)/arch/riscv/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
> diff --git a/arch/riscv/install.sh b/arch/riscv/install.sh
> new file mode 100644
> index 000000000000..b98c1db899f1
> --- /dev/null
> +++ b/arch/riscv/install.sh
> @@ -0,0 +1,39 @@
> +#!/bin/sh
> +#
> +# arch/riscv/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/ia64/install.sh by Shea Levy
> +#
> +# "make install" script for riscv 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 - no bootloader configuration (yet?)
> +base=$(basename $2)
> +
> +if [ -f $4/$base ]; then
> +	mv $4/$base $4/$base.old
> +fi
> +
> +if [ -f $4/System.map ]; then
> +	mv $4/System.map $4/System.old
> +fi
> +
> +cat $2 > $4/$base
> +cp $3 $4/System.map

Thanks.  I'm targeting this for linux-next now.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-24  0:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-20  0:04 [PATCH] riscv: Add install target to Makefile Shea Levy
2018-02-20 16:03 ` [PATCH v2] " Shea Levy
2018-02-24  0:40   ` Palmer Dabbelt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.