From 13d892eef1c78d14314b7d3a2cb9035e9ba1420c Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Wed, 19 Oct 2016 17:02:41 +0200 Subject: nwztools: update makefile and add script The new script allows the upgrade to execute a file found on the user partition. Change-Id: I564941d01bcdbae050002e77cb119f3d95ecdc21 --- utils/nwztools/scripts/Makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'utils/nwztools/scripts/Makefile') diff --git a/utils/nwztools/scripts/Makefile b/utils/nwztools/scripts/Makefile index 36ccfbb496..207534a006 100644 --- a/utils/nwztools/scripts/Makefile +++ b/utils/nwztools/scripts/Makefile @@ -8,7 +8,8 @@ all: @echo "- dump_rootfs: dumps the root filesystem to rootfs.tgz" @echo "- do_fw_upgrade: put the device in NWZ_DEV in firmware upgrade mode" @echo "- copy_fw_upgrade: copy firmware to a device with the right name" - @echo "- exec_file: craft an upgrade that executes a script/executable" + @echo "- exec_file: craft an upgrade that embeds and execute a file" + @echo "- exec_file_extern: craft an upgrade that execute a file on the user partition" @echo "- list_targets: produce of list of available targets" ifndef UPG @@ -43,6 +44,7 @@ ifndef NWZ_DEV want_dev: $(info Please set NWZ_DEV to your dev. For example:) $(info make do_fw_upgrade NWZ_DEV=/dev/sdx) + $(error "") else want_dev: ; endif @@ -51,15 +53,33 @@ ifndef NWZ_MOUNT want_mount: $(info Please set NWZ_MOUNT to your dev mount point. For example:) $(info make copy_fw_upgrade NWZ_MOUNT=/media/WALKMAN ...) + $(error "") else want_mount: ; endif +ifndef LOG +want_log: + $(info Please set LOG to the log filename. For example:) + $(info make exec_file_extern LOG=exec.log ...) + $(error "") +else +want_log: ; +endif + UPGPACK=$(upgtool) -c -m $(NWZ_TARGET) $(UPG) $(1) exec_file: want_target want_exec want_upg $(call UPGPACK, exec_file.sh $(EXEC)) +exec_file_extern.tmp: want_exec want_upg want_log + cat exec_file_extern.sh.in | sed "s|NWZ_EXEC_THIS|$(EXEC)|" |\ + sed "s|NWZ_LOG_THIS|$(LOG)|" > $@ +.INTERMEDIATE: exec_file_extern.tmp + +exec_file_extern: want_target want_exec want_upg want_log exec_file_extern.tmp + $(call UPGPACK, exec_file_extern.tmp) + dump_rootfs: want_target want_upg $(call UPGPACK, dump_rootfs.sh) -- cgit v1.2.3