Skip to contentSkip to conversation

pkg-infra: do the package install before installing init files

PATCH New Yann E. MORIN 3 participants 4 messages Jul 6, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pkg-infra: do the package install before installing init files

The init hooks may reference files installed by the package. For example, when a package installs systemd unit files, and wants them enabled/disabled by default, the init hokk may move/symlink/rename the unit files.

Currently, the init hooks are called before the package is installed, thus breaking the use-case above.

Just inverse the install orderr, so that a package is installed before its init hooks are called.

---
 package/pkg-generic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-generic.mk +1 -1
index b7f50a5..bc8a12e 100644
@@ -228,11 +228,11 @@ $(BUILD_DIR)/%/.stamp_target_installed:
 	@$(call step_start,install-target)
 	@$(call MESSAGE,"Installing to target")
 	$(foreach hook,$($(PKG)_PRE_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
+	+$($(PKG)_INSTALL_TARGET_CMDS)
 	$(if $(BR2_INIT_SYSTEMD),\
 		$($(PKG)_INSTALL_INIT_SYSTEMD))
 	$(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
 		$($(PKG)_INSTALL_INIT_SYSV))
-	+$($(PKG)_INSTALL_TARGET_CMDS)
 	$(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
 	$(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
 		$(RM) -f $(addprefix $(TARGET_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ; \
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 pkg-infra: do the package install before installing init files

Hi Yann

Small typos in commit message:

"Yann E. MORIN" <[email protected]> schreef:

Quoted 3 lines

The init hooks may reference files installed by the package. For example, when a package installs systemd unit files, and wants them enabled/disabled by default, the init hokk may move/symlink/rename the

hook

Quoted 6 lines

unit files.

Currently, the init hooks are called before the package is installed, thus breaking the use-case above.

Just inverse the install orderr, so that a package is installed before

order

Quoted 17 lines

its init hooks are called.

---
package/pkg-generic.mk | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-generic.mk +0 -0
index b7f50a5..bc8a12e 100644
@@ -228,11 +228,11 @@ $(BUILD_DIR)/%/.stamp_target_installed:
 	@$(call step_start,install-target)
 	@$(call MESSAGE,"Installing to target")

package/pkg-generic.mk $(BUILD_DIR)/%/.stamp_target_installed: · line 238

Quoted 10 lines
package/pkg-generic.mk +1 -1
 	$(foreach hook,$($(PKG)_PRE_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
+	+$($(PKG)_INSTALL_TARGET_CMDS)
 	$(if $(BR2_INIT_SYSTEMD),\
 		$($(PKG)_INSTALL_INIT_SYSTEMD))
 	$(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
 		$($(PKG)_INSTALL_INIT_SYSV))
-	+$($(PKG)_INSTALL_TARGET_CMDS)
 	$(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
 	$(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
 		$(RM) -f $(addprefix $(TARGET_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ; \

Best regards,
Thomas

#2 lore raw

PATCH 1/1 pkg-infra: do the package install before installing init files

Thomas, All,

On 2014-07-06 16:40 +0200, Thomas De Schampheleire spake thusly:

Quoted 1 line

Small typos in commit message:

Yep, fixed. Thanks! :-)

I will wait a bit for more reviews before re-sending.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 pkg-infra: do the package install before installing init files

In reply to Yann E. MORIN
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

The init hooks may reference files installed by the package. For example, when a package installs systemd unit files, and wants them enabled/disabled by default, the init hokk may move/symlink/rename the unit files.

Currently, the init hooks are called before the package is installed, thus breaking the use-case above.

Quoted 7 lines

Just inverse the install orderr, so that a package is installed before its init hooks are called.

Makes sense - Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard