Skip to contentSkip to conversation

Reinstall Targets

RFC PATCH Superseded Doug Kehn 2 participants 3 messages Nov 22, 2014

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Doug Kehn

author
#0 lore raw

cover Reinstall Targets

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

These targets remove the package's .stamp_*_installed file to allow the <package>-install, <package>-install-staging, <package>-install-target targets 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 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-clean-for-target-reinstall \
	foo-install-target
make TARGET_DIR=${PWD}/update \
	bar-clean-for-target-reinstall \
	bar-install-target

This proposal may also form the basis for the "TODO items under discussion" for a make target to reinstall everything to the target.

* This is my first attempt at proposing a Buildroot submission. Please
* let me know if I'm doing it wrong and/or what I can do better.

Doug Kehn (1):
pkg-generic.mk: -clean-for-*-reinstall targets

 package/pkg-generic.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 pkg-generic.mk: -clean-for-*-reinstall targets

Add targets to remove package .stamp_target_install file to allow <package>-install-target to reinstall <package> in the target directory.

---
 package/pkg-generic.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/pkg-generic.mk +8 -0
index 9643a30..c723f80 100644
@@ -594,6 +594,14 @@ $(1)-clean-for-reconfigure: $(1)-clean-for-rebuild
 
 $(1)-reconfigure:	$(1)-clean-for-reconfigure $(1)
 
+$(1)-clean-for-staging-reinstall:
+			rm -f $$($(2)_TARGET_INSTALL_STAGING)
+
+$(1)-clean-for-target-reinstall:
+			rm -f $$($(2)_TARGET_INSTALL_TARGET)
+
+$(1)-clean-for-reinstall: $(1)-clean-for-staging-reinstall $(1)-clean-for-target-reinstall
+
 # define the PKG variable for all targets, containing the
 # uppercase package variable prefix
 $$($(2)_TARGET_INSTALL_TARGET):		PKG=$(2)
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/1 pkg-generic.mk: -clean-for-*-reinstall targets

Dear Doug Kehn,

Quoted 17 lines · Doug Kehn

Add targets to remove package .stamp_target_install file to allow <package>-install-target to reinstall <package> in the target directory.

---
 package/pkg-generic.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/pkg-generic.mk +1 -0
index 9643a30..c723f80 100644
@@ -594,6 +594,14 @@ $(1)-clean-for-reconfigure: $(1)-clean-for-rebuild
 
 $(1)-reconfigure:	$(1)-clean-for-reconfigure $(1)
 
+$(1)-clean-for-staging-reinstall:

package/pkg-generic.mk $(1)-clean-for-reconfigure: $(1)-clean-for-rebuild · line 607

Quoted 10 lines
package/pkg-generic.mk +7 -0
+			rm -f $$($(2)_TARGET_INSTALL_STAGING)
+
+$(1)-clean-for-target-reinstall:
+			rm -f $$($(2)_TARGET_INSTALL_TARGET)
+
+$(1)-clean-for-reinstall: $(1)-clean-for-staging-reinstall $(1)-clean-for-target-reinstall
+
 # define the PKG variable for all targets, containing the
 # uppercase package variable prefix
 $$($(2)_TARGET_INSTALL_TARGET):		PKG=$(2)

Thanks for this contribution. I think if we want to do this, we should mimic the existing <pkg>-reconfigure and <pkg>-rebuild target, by introducing a <pkg>-reinstall target.

Also, the patch should take into account both the case of target packages (which your patch is doing) *and* the case of host packages (which your patch forgets).

Finally, like <pkg>-reconfigure and <pkg>-rebuild, I think <pkg>-clean-for-reinstall should also remove the $$($(2)_TARGET_RSYNC) stamp file when $$($(2)_OVERRIDE_SRCDIR) is not empty.

Can you work on an updated version that takes into account those comments?

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com