Skip to content

Commit

Permalink
nerves_heart: remove wildcard install location
Browse files Browse the repository at this point in the history
While the wildcard part didn't break, the environment variable setting
in the script failed with the Buildroot update. Rather than fix, specify
the install path exactly using the Erlang update to expose the ERTS
version.

NOTES:

1. Target installation hasn't been used in a long time so I deleted it.
   The mix release creation logic copies ERTS over from the staging
   directory.
2. The install command no longer creates parent directories
   automatically. This makes it fail if the ERTS directory path isn't
   right. This is nice since when it didn't fail, you get the default heart
   program that doesn't pet the hardware watchdog and then the device
   reboots.
  • Loading branch information
fhunleth committed May 20, 2022
1 parent c5cc21d commit e0162c0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions package/nerves_heart/nerves_heart.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,14 @@ NERVES_HEART_LICENSE = MIT
NERVES_HEART_LICENSE_FILES = LICENSE
NERVES_HEART_DEPENDENCIES = erlang
NERVES_HEART_INSTALL_STAGING = YES
NERVES_HEART_INSTALL_TARGET = NO

define NERVES_HEART_BUILD_CMDS
$(MAKE1) $(TARGET_CONFIGURE_OPTS) -C $(@D)
endef

define NERVES_HEART_INSTALL_TARGET_CMDS
ERTS_BIN=$(ls $(TARGET_DIR)/usr/lib/erlang/erts-*/bin);\
if -e "$(ERTS_BIN)"; then $(INSTALL) -D -m 755 $(@D)/heart $(ERTS_BIN)/heart; fi
endef

define NERVES_HEART_INSTALL_STAGING_CMDS
ERTS_BIN=$(ls $(STAGING_DIR)/usr/lib/erlang/erts-*/bin);\
if -e "$(ERTS_BIN)"; then $(INSTALL) -D -m 755 $(@D)/heart $(ERTS_BIN)/heart; fi
$(INSTALL) -m 755 $(@D)/heart "$(STAGING_DIR)/usr/lib/erlang/erts-$(ERLANG_ERTS_VSN)/bin/heart"
endef

$(eval $(generic-package))

0 comments on commit e0162c0

Please sign in to comment.