Skip to content

Commit

Permalink
assemble-firmware: add parameter "-e"
Browse files Browse the repository at this point in the history
Parameter "-e" will define a directory with files that
will be included into the Firmware-images

This is the implementation of previous commit "use
openwrt/files to embedd files directly into image" for
the imagebuilder
  • Loading branch information
SvenRoederer committed Jan 26, 2017
1 parent a66896d commit ebe7cf9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ firmwares: stamp-clean-firmwares .stamp-firmwares
FEED_REVISION=`cd $$FEED_DIR; $(REVISION)`; \
echo "Feed $$FEED: repository from $$FEED_GIT_REPO, git branch \"$$FEED_GIT_BRANCH_ESC\", revision $$FEED_REVISION" >> $$VERSION_FILE; \
done
./assemble_firmware.sh -p "$(PROFILES)" -i $(IB_FILE) -t $(FW_TARGET_DIR) -u "$(PACKAGES_LIST_DEFAULT)"
./assemble_firmware.sh -p "$(PROFILES)" -i $(IB_FILE) -e $(FW_DIR)/embedded-files -t $(FW_TARGET_DIR) -u "$(PACKAGES_LIST_DEFAULT)"
# get relative path of firmwaredir
$(eval RELPATH := $(shell perl -e 'use File::Spec; print File::Spec->abs2rel(@ARGV) . "\n"' "$(FW_TARGET_DIR)" "$(FW_DIR)" ))
# shorten firmware of images to prevent some (TP-Link) firmware-upgrader from complaining
Expand Down
12 changes: 11 additions & 1 deletion assemble_firmware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,21 @@ $0 -i <IB_FILE> -p <profile>
-l <dir> (optional) directory to the package lists
-n <dir> (optional) path to a temp directory
-u <list> usecase. seperate multiple usecases by a space
-e <dir> (optional) directory of files to directtly include into image
"
}

while getopts "di:l:n:p:t:u:" option; do
while getopts "di:l:n:p:t:u:e:" option; do
case "$option" in
d)
DEBUG=y
;;
i)
IB_FILE="$OPTARG"
;;
e)
MBED_DIR="$OPTARG"
;;
p)
PROFILES="$OPTARG"
;;
Expand Down Expand Up @@ -163,6 +167,12 @@ for profile in $PROFILES ; do
img_params="$img_params CUSTOM_POSTINST_SCRIPT=$hookfile"
fi

if [ -n "$MBED_DIR" ]; then
mbed_dir=$(to_absolute_path "${MBED_DIR}")
info "embedding files from $mbed_dir."
img_params="$img_params FILES=$mbed_dir"
fi

packages=$(parse_pkg_list_file "${PKGLIST_DIR}/${package_list}.txt")

# ensure BIN_DIR is valid
Expand Down

0 comments on commit ebe7cf9

Please sign in to comment.