[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: flash-kernel: handle DTBs in vendor subdir



On 2016-07-30, Martin Michlmayr wrote:
> DTBs on arm64 are stored as vendor/dtb rather than everything in one
> directory.  flash-kernel doesn't handle this at the moment.  I see two
> options:
>
> 1) Strip the vendor dir away and install the dtb as
> /boot/dtbs/$kvers/dtb
>
> 2) Keep the directory and install as /boot/dtbs/$kvers/vendor/dtb
>
> In both cases, I think we should accept local DTBs in
> /etc/flash-kernel/dtbs either as vendor/dtb or just dtb.
>
> The patch below implements options 1.  Do people think this is the
> right path or would you prefer option 2?
>
> Actually, now that I look at the boot script, I think the real
> question is: does ${fdtfile} from u-boot contain the directory or not?
> I believe the answer is no, so option 1 is the right on.

I haven't seen u-boot platforms that set fdtfile to include the
directory.

The only risk i see is if different vendors implemented a .dtb with the
same name but in a different vendor dir... but I'm hoping the odds of
that, while not impossible, are highly unlikely.


> Any problems with the proposed patch?

> diff --git a/functions b/functions
> index 0f597b8..06a0c39 100644
> --- a/functions
> +++ b/functions
> @@ -560,6 +560,8 @@ find_dtb_file() {
>  	*)
>  		if [ -e "/etc/flash-kernel/dtbs/$dtb_name" ] ; then
>  			echo "/etc/flash-kernel/dtbs/$dtb_name"
> +		elif [ -e "/etc/flash-kernel/dtbs/$(basename $dtb_name)" ] ; then
> +			echo "/etc/flash-kernel/dtbs/$(basename $dtb_name)"
>  		else
>  			echo "/usr/lib/linux-image-$kvers/$dtb_name"
>  		fi
> @@ -573,6 +575,11 @@ handle_dtb() {
>  	fi
>  
>  	local dtb=$(find_dtb_file)
> +	# DTBs on arm64 are stored in subdirs for each vendor; strip the
> +	# dir away because we want to put the file in /boot/dtbs/$kvers/
> +	# without additional subdirs.
> +	local dtb_name=$(basename $dtb_name)
> +
>  	if [ "x$FK_KERNEL_HOOK_SCRIPT" = "xpostrm.d" ] ; then
>  		rm -f "/boot/dtbs/$kvers/$dtb_name"


Thanks for the patch! Looks good and simple to me.

I presume the database entries for platforms that need it would then
include the vendor like this:

  DTB-Id: VENDOR/PLATFORM.dtb


live well,
  vagrant

Attachment: signature.asc
Description: PGP signature


Reply to: