Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] linux-dtb: strip DTB extension properly in postinst/postrm
@ 2016-12-21 20:20 Denys Dmytriyenko
  2017-01-05 20:18 ` Denys Dmytriyenko
  0 siblings, 1 reply; 2+ messages in thread
From: Denys Dmytriyenko @ 2016-12-21 20:20 UTC (permalink / raw)
  To: openembedded-core; +Cc: Denys Dmytriyenko

From: Denys Dmytriyenko <denys@ti.com>

The use of awk -F "." in do_install/do_deploy to strip filename extension
was deprecated long time ago in 72980d5bb465f0640ed451d1ebb9c5d2a210ad0c.

Make a similar change in postinst/postrm to properly use basename command.

Otherwise DTB files that contain dots in the name result in broken symlinks
that point to non-existent truncated files.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
---
 meta/recipes-kernel/linux/linux-dtb.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
index 8528d64..2f378a1 100644
--- a/meta/recipes-kernel/linux/linux-dtb.inc
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -68,7 +68,7 @@ pkg_postinst_kernel-devicetree () {
 		for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
 			symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
 			DTB_EXT=${DTB##*.}
-			DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'`
+			DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
 			DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
 			update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} ${DTB_BASE_NAME}.${DTB_EXT} /boot/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
 		done
@@ -81,7 +81,7 @@ pkg_postrm_kernel-devicetree () {
 		for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
 			symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
 			DTB_EXT=${DTB##*.}
-			DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'`
+			DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
 			DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
 			update-alternatives --remove ${DTB_BASE_NAME}.${DTB_EXT} /boot/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
 		done
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] linux-dtb: strip DTB extension properly in postinst/postrm
  2016-12-21 20:20 [PATCH] linux-dtb: strip DTB extension properly in postinst/postrm Denys Dmytriyenko
@ 2017-01-05 20:18 ` Denys Dmytriyenko
  0 siblings, 0 replies; 2+ messages in thread
From: Denys Dmytriyenko @ 2017-01-05 20:18 UTC (permalink / raw)
  To: openembedded-core

Ping.

On Wed, Dec 21, 2016 at 03:20:17PM -0500, Denys Dmytriyenko wrote:
> From: Denys Dmytriyenko <denys@ti.com>
> 
> The use of awk -F "." in do_install/do_deploy to strip filename extension
> was deprecated long time ago in 72980d5bb465f0640ed451d1ebb9c5d2a210ad0c.
> 
> Make a similar change in postinst/postrm to properly use basename command.
> 
> Otherwise DTB files that contain dots in the name result in broken symlinks
> that point to non-existent truncated files.
> 
> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> ---
>  meta/recipes-kernel/linux/linux-dtb.inc | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
> index 8528d64..2f378a1 100644
> --- a/meta/recipes-kernel/linux/linux-dtb.inc
> +++ b/meta/recipes-kernel/linux/linux-dtb.inc
> @@ -68,7 +68,7 @@ pkg_postinst_kernel-devicetree () {
>  		for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
>  			symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
>  			DTB_EXT=${DTB##*.}
> -			DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'`
> +			DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
>  			DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
>  			update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} ${DTB_BASE_NAME}.${DTB_EXT} /boot/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
>  		done
> @@ -81,7 +81,7 @@ pkg_postrm_kernel-devicetree () {
>  		for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
>  			symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
>  			DTB_EXT=${DTB##*.}
> -			DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'`
> +			DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
>  			DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
>  			update-alternatives --remove ${DTB_BASE_NAME}.${DTB_EXT} /boot/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
>  		done
> -- 
> 2.7.4
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-05 20:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-21 20:20 [PATCH] linux-dtb: strip DTB extension properly in postinst/postrm Denys Dmytriyenko
2017-01-05 20:18 ` Denys Dmytriyenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox