summaryrefslogtreecommitdiff
path: root/utils/nwztools/scripts/Makefile
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-10-19 17:02:41 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2016-10-19 17:09:04 +0200
commit13d892eef1c78d14314b7d3a2cb9035e9ba1420c (patch)
treefdd330f4f0d5a1d317b63ac2faca1255c1c6e8b5 /utils/nwztools/scripts/Makefile
parenteaa1cb3469c1abef0433c1a23102b53d59e47814 (diff)
downloadrockbox-13d892eef1c78d14314b7d3a2cb9035e9ba1420c.tar.gz
rockbox-13d892eef1c78d14314b7d3a2cb9035e9ba1420c.zip
nwztools: update makefile and add script
The new script allows the upgrade to execute a file found on the user partition. Change-Id: I564941d01bcdbae050002e77cb119f3d95ecdc21
Diffstat (limited to 'utils/nwztools/scripts/Makefile')
-rw-r--r--utils/nwztools/scripts/Makefile22
1 files changed, 21 insertions, 1 deletions
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:
8 @echo "- dump_rootfs: dumps the root filesystem to rootfs.tgz" 8 @echo "- dump_rootfs: dumps the root filesystem to rootfs.tgz"
9 @echo "- do_fw_upgrade: put the device in NWZ_DEV in firmware upgrade mode" 9 @echo "- do_fw_upgrade: put the device in NWZ_DEV in firmware upgrade mode"
10 @echo "- copy_fw_upgrade: copy firmware to a device with the right name" 10 @echo "- copy_fw_upgrade: copy firmware to a device with the right name"
11 @echo "- exec_file: craft an upgrade that executes a script/executable" 11 @echo "- exec_file: craft an upgrade that embeds and execute a file"
12 @echo "- exec_file_extern: craft an upgrade that execute a file on the user partition"
12 @echo "- list_targets: produce of list of available targets" 13 @echo "- list_targets: produce of list of available targets"
13 14
14ifndef UPG 15ifndef UPG
@@ -43,6 +44,7 @@ ifndef NWZ_DEV
43want_dev: 44want_dev:
44 $(info Please set NWZ_DEV to your dev. For example:) 45 $(info Please set NWZ_DEV to your dev. For example:)
45 $(info make do_fw_upgrade NWZ_DEV=/dev/sdx) 46 $(info make do_fw_upgrade NWZ_DEV=/dev/sdx)
47 $(error "")
46else 48else
47want_dev: ; 49want_dev: ;
48endif 50endif
@@ -51,15 +53,33 @@ ifndef NWZ_MOUNT
51want_mount: 53want_mount:
52 $(info Please set NWZ_MOUNT to your dev mount point. For example:) 54 $(info Please set NWZ_MOUNT to your dev mount point. For example:)
53 $(info make copy_fw_upgrade NWZ_MOUNT=/media/WALKMAN ...) 55 $(info make copy_fw_upgrade NWZ_MOUNT=/media/WALKMAN ...)
56 $(error "")
54else 57else
55want_mount: ; 58want_mount: ;
56endif 59endif
57 60
61ifndef LOG
62want_log:
63 $(info Please set LOG to the log filename. For example:)
64 $(info make exec_file_extern LOG=exec.log ...)
65 $(error "")
66else
67want_log: ;
68endif
69
58UPGPACK=$(upgtool) -c -m $(NWZ_TARGET) $(UPG) $(1) 70UPGPACK=$(upgtool) -c -m $(NWZ_TARGET) $(UPG) $(1)
59 71
60exec_file: want_target want_exec want_upg 72exec_file: want_target want_exec want_upg
61 $(call UPGPACK, exec_file.sh $(EXEC)) 73 $(call UPGPACK, exec_file.sh $(EXEC))
62 74
75exec_file_extern.tmp: want_exec want_upg want_log
76 cat exec_file_extern.sh.in | sed "s|NWZ_EXEC_THIS|$(EXEC)|" |\
77 sed "s|NWZ_LOG_THIS|$(LOG)|" > $@
78.INTERMEDIATE: exec_file_extern.tmp
79
80exec_file_extern: want_target want_exec want_upg want_log exec_file_extern.tmp
81 $(call UPGPACK, exec_file_extern.tmp)
82
63dump_rootfs: want_target want_upg 83dump_rootfs: want_target want_upg
64 $(call UPGPACK, dump_rootfs.sh) 84 $(call UPGPACK, dump_rootfs.sh)
65 85