Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 0/2] [RFC] Reinstall Targets
@ 2014-11-27  4:48 Doug Kehn
  2014-11-27  4:48 ` [Buildroot] [PATCH v2 1/2] pkg-generic.mk: reinstall targets Doug Kehn
  2014-11-27  4:48 ` [Buildroot] [PATCH v2 2/2] manual: " Doug Kehn
  0 siblings, 2 replies; 5+ messages in thread
From: Doug Kehn @ 2014-11-27  4:48 UTC (permalink / raw)
  To: buildroot

This RFC proposes adding the following targets to pkg-generic.mk:
	<package>-reinstall
	<package>-reinstall-target
	<package>-reinstall-staging
	<package>-reinstall-images
	<package>-reinstall-host

These targets remove the package's .stamp_*_installed file to allow the
reinstall to execute.  The only method I presently know of to reinstall a
package is to make <package>-rebuild.  The proposed targets allow a package
reinstall without, unnecessarily incurring a rebuild of the package.

In addition to allowing a reinstall to staging and/or target output
directories, the proposed targets allow selected packages to be
installed to a different 'target' directory.  For example, I attempt to
keep software updates as small as possible; therefore, I cherry-pick
files to include in the update package.  If I know packages foo and bar
have been updated, the following will install those packages to a
directory that can be further processed to generate the desired update
package.

make TARGET_DIR=${PWD}/update foo-reinstall-target

make TARGET_DIR=${PWD}/update bar-reinstall-target

Doug Kehn (2):
  pkg-generic.mk: reinstall targets
  manual: reinstall targets

 docs/manual/package-make-target.txt | 26 ++++++++++++++++++++------
 package/pkg-generic.mk              | 28 +++++++++++++++++++++++++---
 2 files changed, 45 insertions(+), 9 deletions(-)

---
Changes v1 -> v2:
  - Reworked to include reinstall target (requested by Thomas)
  - Updated documentation

-- 
1.9.1

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

* [Buildroot] [PATCH v2 1/2] pkg-generic.mk: reinstall targets
  2014-11-27  4:48 [Buildroot] [PATCH v2 0/2] [RFC] Reinstall Targets Doug Kehn
@ 2014-11-27  4:48 ` Doug Kehn
  2014-11-27 18:08   ` Yann E. MORIN
  2014-11-27  4:48 ` [Buildroot] [PATCH v2 2/2] manual: " Doug Kehn
  1 sibling, 1 reply; 5+ messages in thread
From: Doug Kehn @ 2014-11-27  4:48 UTC (permalink / raw)
  To: buildroot

Add reinstall targets for host, target, staging, and images variants.
clean-for-reinstall targets added to remove package
.stamp_target_install file to allow package install.  Additionally, when
OVERRIDE_SRCDIR is provided, .stamp_rsynced is removed to ensure pakcage
is up to date before reinstalling.

Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
---
 package/pkg-generic.mk | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 9643a30..3c25778 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -480,34 +480,51 @@ $(1):			$(1)-install
 
 ifeq ($$($(2)_TYPE),host)
 $(1)-install:	        $(1)-install-host
+$(1)-reinstall:		$(1)-reinstall-host
 else
 $(1)-install:		$(1)-install-staging $(1)-install-target $(1)-install-images
+$(1)-reinstall:		$(1)-reinstall-staging $(1)-reinstall-target $(1)-reinstall-images
 endif
 
 ifeq ($$($(2)_INSTALL_TARGET),YES)
-$(1)-install-target:		$$($(2)_TARGET_INSTALL_TARGET)
+$(1)-install-target:			$$($(2)_TARGET_INSTALL_TARGET)
+$(1)-reinstall-target:			$(1)-clean-for-reinstall-target $$($(2)_TARGET_INSTALL_TARGET)
+$(1)-clean-for-reinstall-target:	$(1)-clean-for-reinstall
+			rm -f $$($(2)_TARGET_INSTALL_TARGET)
 $$($(2)_TARGET_INSTALL_TARGET):	$$($(2)_TARGET_BUILD)
 else
 $(1)-install-target:
+$(1)-reinstall-target:
 endif
 
 ifeq ($$($(2)_INSTALL_STAGING),YES)
 $(1)-install-staging:			$$($(2)_TARGET_INSTALL_STAGING)
+$(1)-reinstall-staging:			$(1)-clean-for-reinstall-staging $$($(2)_TARGET_INSTALL_STAGING)
+$(1)-clean-for-reinstall-staging:	$(1)-clean-for-reinstall
+			rm -f $$($(2)_TARGET_INSTALL_STAGING)
 $$($(2)_TARGET_INSTALL_STAGING):	$$($(2)_TARGET_BUILD)
 # Some packages use install-staging stuff for install-target
 $$($(2)_TARGET_INSTALL_TARGET):		$$($(2)_TARGET_INSTALL_STAGING)
 else
 $(1)-install-staging:
+$(1)-reinstall-staging:
 endif
 
 ifeq ($$($(2)_INSTALL_IMAGES),YES)
-$(1)-install-images:		$$($(2)_TARGET_INSTALL_IMAGES)
-$$($(2)_TARGET_INSTALL_IMAGES):	$$($(2)_TARGET_BUILD)
+$(1)-install-images:			$$($(2)_TARGET_INSTALL_IMAGES)
+$(1)-reinstall-images:			$(1)-clean-for-reinstall-images $$($(2)_TARGET_INSTALL_IMAGES)
+$(1)-clean-for-reinstall-images:	$(1)-clean-for-reinstall
+			rm -f $$($(2)_TARGET_INSTALL_IMAGES)
+$$($(2)_TARGET_INSTALL_IMAGES):		$$($(2)_TARGET_BUILD)
 else
 $(1)-install-images:
+$(1)-reinstall-images:
 endif
 
 $(1)-install-host:      	$$($(2)_TARGET_INSTALL_HOST)
+$(1)-reinstall-host:      	$(1)-clean-for-reinstall-host $$($(2)_TARGET_INSTALL_HOST)
+$(1)-clean-for-reinstall-host:	$(1)-clean-for-reinstall
+			rm -f $$($(2)_TARGET_INSTALL_HOST)
 $$($(2)_TARGET_INSTALL_HOST):	$$($(2)_TARGET_BUILD)
 
 $(1)-build:		$$($(2)_TARGET_BUILD)
@@ -545,6 +562,8 @@ $$($(2)_TARGET_EXTRACT):	$$($(2)_TARGET_SOURCE)
 $(1)-depends:		$$($(2)_FINAL_DEPENDENCIES)
 
 $(1)-source:		$$($(2)_TARGET_SOURCE)
+
+$(1)-clean-for-reinstall:
 else
 # In the package override case, the sequence of steps
 #  source, by rsyncing
@@ -563,6 +582,9 @@ $(1)-extract:		$(1)-rsync
 $(1)-rsync:		$$($(2)_TARGET_RSYNC)
 
 $(1)-source:		$$($(2)_TARGET_RSYNC_SOURCE)
+
+$(1)-clean-for-reinstall:
+			rm -f $$($(2)_TARGET_RSYNC)
 endif
 
 $(1)-show-depends:
-- 
1.9.1

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

* [Buildroot] [PATCH v2 2/2] manual: reinstall targets
  2014-11-27  4:48 [Buildroot] [PATCH v2 0/2] [RFC] Reinstall Targets Doug Kehn
  2014-11-27  4:48 ` [Buildroot] [PATCH v2 1/2] pkg-generic.mk: reinstall targets Doug Kehn
@ 2014-11-27  4:48 ` Doug Kehn
  1 sibling, 0 replies; 5+ messages in thread
From: Doug Kehn @ 2014-11-27  4:48 UTC (permalink / raw)
  To: buildroot

Add reinstall target information to package-make-target.txt.

Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
---
 docs/manual/package-make-target.txt | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/docs/manual/package-make-target.txt b/docs/manual/package-make-target.txt
index 25d3f44..35d787e 100644
--- a/docs/manual/package-make-target.txt
+++ b/docs/manual/package-make-target.txt
@@ -57,24 +57,38 @@ Additionally, there are some other useful make targets:
 
 [width="90%",cols="^1,4",options="header"]
 |===================================================
-| command/target    | Description
+| command/target      | Description
 
-| +show-depends+    | Displays the dependencies required to build the
+| +show-depends+      | Displays the dependencies required to build the
 package
 
-| +graph-depends+   | Generate a dependency graph of the package, in the
+| +graph-depends+     | Generate a dependency graph of the package, in the
 context of the current Buildroot configuration. See
 xref:graph-depends[this section] for more details about dependency
 graphs.
 
-| +dirclean+        | Remove the whole package build directory
+| +dirclean+          | Remove the whole package build directory
 
-| +rebuild+         | Re-run the compilation commands - this only makes
+| +rebuild+           | Re-run the compilation commands - this only makes
 sense when using the +OVERRIDE_SRCDIR+ feature or when you modified a file
 directly in the build directory
 
-| +reconfigure+     | Re-run the configure commands, then rebuild - this only
+| +reconfigure+       | Re-run the configure commands, then rebuild - this only
 makes sense when using the +OVERRIDE_SRCDIR+ feature or when you modified a
 file directly in the build directory
 
+| +reinstall-staging+ |
+*target package:* Re-run the installation of the package in the staging
+directory - this only makes sense when overriding +STAGING_DIR+
+
+| +reinstall-target+  |
+*target package:* Re-run the installation of the package in the target
+directory - this only makes sense when overriding +TARGET_DIR+
+
+| +reinstall+         |
+*target package:* Run the 2 previous re-installation commands
+
+*host package:* Re-run the installation of the package in the host
+directory
+
 |===================================================
-- 
1.9.1

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

* [Buildroot] [PATCH v2 1/2] pkg-generic.mk: reinstall targets
  2014-11-27  4:48 ` [Buildroot] [PATCH v2 1/2] pkg-generic.mk: reinstall targets Doug Kehn
@ 2014-11-27 18:08   ` Yann E. MORIN
  2014-11-27 18:32     ` Doug Kehn
  0 siblings, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2014-11-27 18:08 UTC (permalink / raw)
  To: buildroot

Doug, All,

On 2014-11-26 22:48 -0600, Doug Kehn spake thusly:
> Add reinstall targets for host, target, staging, and images variants.
> clean-for-reinstall targets added to remove package
> .stamp_target_install file to allow package install.  Additionally, when
> OVERRIDE_SRCDIR is provided, .stamp_rsynced is removed to ensure pakcage
> is up to date before reinstalling.
> 
> Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
> ---
>  package/pkg-generic.mk | 28 +++++++++++++++++++++++++---
>  1 file changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 9643a30..3c25778 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -480,34 +480,51 @@ $(1):			$(1)-install
>  
>  ifeq ($$($(2)_TYPE),host)
>  $(1)-install:	        $(1)-install-host
> +$(1)-reinstall:		$(1)-reinstall-host
>  else
>  $(1)-install:		$(1)-install-staging $(1)-install-target $(1)-install-images
> +$(1)-reinstall:		$(1)-reinstall-staging $(1)-reinstall-target $(1)-reinstall-images
>  endif
>  
>  ifeq ($$($(2)_INSTALL_TARGET),YES)
> -$(1)-install-target:		$$($(2)_TARGET_INSTALL_TARGET)
> +$(1)-install-target:			$$($(2)_TARGET_INSTALL_TARGET)

This patch is mixing style cleanups with actual new code.
I'm not opposed to the cleanups, except they should be part of a
seoarate patch.

Regards,
Yann E. MORIN.

> +$(1)-reinstall-target:			$(1)-clean-for-reinstall-target $$($(2)_TARGET_INSTALL_TARGET)
> +$(1)-clean-for-reinstall-target:	$(1)-clean-for-reinstall
> +			rm -f $$($(2)_TARGET_INSTALL_TARGET)
>  $$($(2)_TARGET_INSTALL_TARGET):	$$($(2)_TARGET_BUILD)
>  else
>  $(1)-install-target:
> +$(1)-reinstall-target:
>  endif
>  
>  ifeq ($$($(2)_INSTALL_STAGING),YES)
>  $(1)-install-staging:			$$($(2)_TARGET_INSTALL_STAGING)
> +$(1)-reinstall-staging:			$(1)-clean-for-reinstall-staging $$($(2)_TARGET_INSTALL_STAGING)
> +$(1)-clean-for-reinstall-staging:	$(1)-clean-for-reinstall
> +			rm -f $$($(2)_TARGET_INSTALL_STAGING)
>  $$($(2)_TARGET_INSTALL_STAGING):	$$($(2)_TARGET_BUILD)
>  # Some packages use install-staging stuff for install-target
>  $$($(2)_TARGET_INSTALL_TARGET):		$$($(2)_TARGET_INSTALL_STAGING)
>  else
>  $(1)-install-staging:
> +$(1)-reinstall-staging:
>  endif
>  
>  ifeq ($$($(2)_INSTALL_IMAGES),YES)
> -$(1)-install-images:		$$($(2)_TARGET_INSTALL_IMAGES)
> -$$($(2)_TARGET_INSTALL_IMAGES):	$$($(2)_TARGET_BUILD)
> +$(1)-install-images:			$$($(2)_TARGET_INSTALL_IMAGES)
> +$(1)-reinstall-images:			$(1)-clean-for-reinstall-images $$($(2)_TARGET_INSTALL_IMAGES)
> +$(1)-clean-for-reinstall-images:	$(1)-clean-for-reinstall
> +			rm -f $$($(2)_TARGET_INSTALL_IMAGES)
> +$$($(2)_TARGET_INSTALL_IMAGES):		$$($(2)_TARGET_BUILD)
>  else
>  $(1)-install-images:
> +$(1)-reinstall-images:
>  endif
>  
>  $(1)-install-host:      	$$($(2)_TARGET_INSTALL_HOST)
> +$(1)-reinstall-host:      	$(1)-clean-for-reinstall-host $$($(2)_TARGET_INSTALL_HOST)
> +$(1)-clean-for-reinstall-host:	$(1)-clean-for-reinstall
> +			rm -f $$($(2)_TARGET_INSTALL_HOST)
>  $$($(2)_TARGET_INSTALL_HOST):	$$($(2)_TARGET_BUILD)
>  
>  $(1)-build:		$$($(2)_TARGET_BUILD)
> @@ -545,6 +562,8 @@ $$($(2)_TARGET_EXTRACT):	$$($(2)_TARGET_SOURCE)
>  $(1)-depends:		$$($(2)_FINAL_DEPENDENCIES)
>  
>  $(1)-source:		$$($(2)_TARGET_SOURCE)
> +
> +$(1)-clean-for-reinstall:
>  else
>  # In the package override case, the sequence of steps
>  #  source, by rsyncing
> @@ -563,6 +582,9 @@ $(1)-extract:		$(1)-rsync
>  $(1)-rsync:		$$($(2)_TARGET_RSYNC)
>  
>  $(1)-source:		$$($(2)_TARGET_RSYNC_SOURCE)
> +
> +$(1)-clean-for-reinstall:
> +			rm -f $$($(2)_TARGET_RSYNC)
>  endif
>  
>  $(1)-show-depends:
> -- 
> 1.9.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH v2 1/2] pkg-generic.mk: reinstall targets
  2014-11-27 18:08   ` Yann E. MORIN
@ 2014-11-27 18:32     ` Doug Kehn
  0 siblings, 0 replies; 5+ messages in thread
From: Doug Kehn @ 2014-11-27 18:32 UTC (permalink / raw)
  To: buildroot

Hi Yann, All,

On Thu, Nov 27, 2014 at 07:08:55PM +0100, Yann E. MORIN wrote:
> Doug, All,
> 
> On 2014-11-26 22:48 -0600, Doug Kehn spake thusly:
> > Add reinstall targets for host, target, staging, and images variants.
> > clean-for-reinstall targets added to remove package
> > .stamp_target_install file to allow package install.  Additionally, when
> > OVERRIDE_SRCDIR is provided, .stamp_rsynced is removed to ensure pakcage
> > is up to date before reinstalling.
> > 
> > Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
> > ---
> >  package/pkg-generic.mk | 28 +++++++++++++++++++++++++---
> >  1 file changed, 25 insertions(+), 3 deletions(-)
> > 
> > diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> > index 9643a30..3c25778 100644
> > --- a/package/pkg-generic.mk
> > +++ b/package/pkg-generic.mk
> > @@ -480,34 +480,51 @@ $(1):			$(1)-install
> >  
> >  ifeq ($$($(2)_TYPE),host)
> >  $(1)-install:	        $(1)-install-host
> > +$(1)-reinstall:		$(1)-reinstall-host
> >  else
> >  $(1)-install:		$(1)-install-staging $(1)-install-target $(1)-install-images
> > +$(1)-reinstall:		$(1)-reinstall-staging $(1)-reinstall-target $(1)-reinstall-images
> >  endif
> >  
> >  ifeq ($$($(2)_INSTALL_TARGET),YES)
> > -$(1)-install-target:		$$($(2)_TARGET_INSTALL_TARGET)
> > +$(1)-install-target:			$$($(2)_TARGET_INSTALL_TARGET)
> 
> This patch is mixing style cleanups with actual new code.
> I'm not opposed to the cleanups, except they should be part of a
> seoarate patch.
> 
> Regards,
> Yann E. MORIN.
> 

I apologize, I did not know that style cleanup needed to be in a
separate patch.  I will resubmit.

Thanks and regards,
...doug

> > +$(1)-reinstall-target:			$(1)-clean-for-reinstall-target $$($(2)_TARGET_INSTALL_TARGET)
> > +$(1)-clean-for-reinstall-target:	$(1)-clean-for-reinstall
> > +			rm -f $$($(2)_TARGET_INSTALL_TARGET)
> >  $$($(2)_TARGET_INSTALL_TARGET):	$$($(2)_TARGET_BUILD)
> >  else
> >  $(1)-install-target:
> > +$(1)-reinstall-target:
> >  endif
> >  
> >  ifeq ($$($(2)_INSTALL_STAGING),YES)
> >  $(1)-install-staging:			$$($(2)_TARGET_INSTALL_STAGING)
> > +$(1)-reinstall-staging:			$(1)-clean-for-reinstall-staging $$($(2)_TARGET_INSTALL_STAGING)
> > +$(1)-clean-for-reinstall-staging:	$(1)-clean-for-reinstall
> > +			rm -f $$($(2)_TARGET_INSTALL_STAGING)
> >  $$($(2)_TARGET_INSTALL_STAGING):	$$($(2)_TARGET_BUILD)
> >  # Some packages use install-staging stuff for install-target
> >  $$($(2)_TARGET_INSTALL_TARGET):		$$($(2)_TARGET_INSTALL_STAGING)
> >  else
> >  $(1)-install-staging:
> > +$(1)-reinstall-staging:
> >  endif
> >  
> >  ifeq ($$($(2)_INSTALL_IMAGES),YES)
> > -$(1)-install-images:		$$($(2)_TARGET_INSTALL_IMAGES)
> > -$$($(2)_TARGET_INSTALL_IMAGES):	$$($(2)_TARGET_BUILD)
> > +$(1)-install-images:			$$($(2)_TARGET_INSTALL_IMAGES)
> > +$(1)-reinstall-images:			$(1)-clean-for-reinstall-images $$($(2)_TARGET_INSTALL_IMAGES)
> > +$(1)-clean-for-reinstall-images:	$(1)-clean-for-reinstall
> > +			rm -f $$($(2)_TARGET_INSTALL_IMAGES)
> > +$$($(2)_TARGET_INSTALL_IMAGES):		$$($(2)_TARGET_BUILD)
> >  else
> >  $(1)-install-images:
> > +$(1)-reinstall-images:
> >  endif
> >  
> >  $(1)-install-host:      	$$($(2)_TARGET_INSTALL_HOST)
> > +$(1)-reinstall-host:      	$(1)-clean-for-reinstall-host $$($(2)_TARGET_INSTALL_HOST)
> > +$(1)-clean-for-reinstall-host:	$(1)-clean-for-reinstall
> > +			rm -f $$($(2)_TARGET_INSTALL_HOST)
> >  $$($(2)_TARGET_INSTALL_HOST):	$$($(2)_TARGET_BUILD)
> >  
> >  $(1)-build:		$$($(2)_TARGET_BUILD)
> > @@ -545,6 +562,8 @@ $$($(2)_TARGET_EXTRACT):	$$($(2)_TARGET_SOURCE)
> >  $(1)-depends:		$$($(2)_FINAL_DEPENDENCIES)
> >  
> >  $(1)-source:		$$($(2)_TARGET_SOURCE)
> > +
> > +$(1)-clean-for-reinstall:
> >  else
> >  # In the package override case, the sequence of steps
> >  #  source, by rsyncing
> > @@ -563,6 +582,9 @@ $(1)-extract:		$(1)-rsync
> >  $(1)-rsync:		$$($(2)_TARGET_RSYNC)
> >  
> >  $(1)-source:		$$($(2)_TARGET_RSYNC_SOURCE)
> > +
> > +$(1)-clean-for-reinstall:
> > +			rm -f $$($(2)_TARGET_RSYNC)
> >  endif
> >  
> >  $(1)-show-depends:
> > -- 
> > 1.9.1
> > 
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
> 
> -- 
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'

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

end of thread, other threads:[~2014-11-27 18:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-27  4:48 [Buildroot] [PATCH v2 0/2] [RFC] Reinstall Targets Doug Kehn
2014-11-27  4:48 ` [Buildroot] [PATCH v2 1/2] pkg-generic.mk: reinstall targets Doug Kehn
2014-11-27 18:08   ` Yann E. MORIN
2014-11-27 18:32     ` Doug Kehn
2014-11-27  4:48 ` [Buildroot] [PATCH v2 2/2] manual: " Doug Kehn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox