summaryrefslogtreecommitdiff
path: root/kbuild.sh
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-09-02 05:11:10 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-09-02 16:38:12 +0300
commitdb1fa470e1af84145ae22411cc35b7a7cccbe965 (patch)
tree519920d6c00efe1ade8c5413539256a9d00f58fe /kbuild.sh
parent0f562883509ddaf1cd66d89f36361262b3bd3f83 (diff)
Support overriding the image file name
Add support for overriding the image file name, using the same mechanism as for DTB files. The 'image' parameter can specify both the image make target and image destination file name, separated by a ':'. If no ':' is found, the image make target is used as the image destination file name. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'kbuild.sh')
-rwxr-xr-xkbuild.sh28
1 files changed, 19 insertions, 9 deletions
diff --git a/kbuild.sh b/kbuild.sh
index 7a87ad9..611d411 100755
--- a/kbuild.sh
+++ b/kbuild.sh
@@ -204,13 +204,23 @@ version=$(cat $output_dir/include/generated/utsrelease.h | cut -d '"' -f 2)
# Create the image
#
-if [[ -r "$kbuild_root/images/$image.sh" ]] ; then
- source "${kbuild_root}/images/$image.sh" || exit 1
- eval make_${image}_image
+_image_type=${image/:*/}
+
+if [[ -r "$kbuild_root/images/${_image_type}.sh" ]] ; then
+ source "${kbuild_root}/images/${_image_type}.sh" || exit 1
+ eval make_${_image_type}_image
else
- image_file=$output_dir/arch/$arch/boot/$image
+ _image_file=${_image_type}
fi
+if echo "${image}" | grep -q ':' ; then
+ _image_name=${image/*:/}
+else
+ _image_name=${_image_file}
+fi
+
+_image_file="$output_dir/arch/$arch/boot/${_image_file}"
+
#
# Copy the files to their destination directories.
#
@@ -229,7 +239,7 @@ copy_dtbs() {
local dest_dir=$1
local dtb
- if [[ $image == FIT || $image == CrOS ]] ; then
+ if [[ $_image_type == FIT || $_image_type == CrOS ]] ; then
return
fi
@@ -244,12 +254,12 @@ copy_dtbs() {
if [[ -d "$target_dir" ]] ; then
mkdir -p $target_dir/boot
- cp $image_file $target_dir/boot/
+ cp ${_image_file} $target_dir/boot/${_image_name}
copy_dtbs $target_dir/boot/
fi
-if [[ $image != CrOS && -d "$tftp_dir" ]] ; then
- cp $image_file $tftp_dir/
+if [[ $_image_type != CrOS && -d "$tftp_dir" ]] ; then
+ cp ${_image_file} $tftp_dir/${_image_name}
copy_dtbs $tftp_dir/
fi
@@ -271,7 +281,7 @@ fi
# Print status and terminate
#
-echo "Kernel image available in $image_file"
+echo "Kernel image available in ${_image_file}"
if [[ x$modules == xmodules ]] ; then
echo "Kernel modules installed to $mod_path/lib/modules/$version"
fi