Control: tags 1025435 patch

On 2022-12-04, Nicolas Frattaroli wrote:
> On Sonntag, 4. Dezember 2022 18:20:38 CET Jonas Smedegaard wrote:
>> Quoting Nicolas Frattaroli (2022-12-04 18:03:30)
>> > u-boot-update should check as the very first thing for FDT
>> > line generation whether the path begin with an /, and if
>> > it does, the file exists, and U_BOOT_FDT_DIR is either
>> > default or empty (which gets set to default) make it use
>> > the U_BOOT_FDT file as-is.
>> > 
>> > This would allow for packages to provide supplemental device trees
>> > without replacing the whole kernel.
...
> A more concrete example is this defaults file:
>
>  
> U_BOOT_FDT=/usr/lib/devicetrees-plebian-quartz64/rockchip/rk3566-soquartz-blade.dtb
>  U_BOOT_FDT_DIR=""
>
> The expected output would be an fdt line in extlinux.conf with
>
>  fdt /usr/lib/devicetrees-plebian-quartz64/rockchip/rk3566-soquartz-blade.dtb
>
> even if /usr/lib/linux-image-$KERNELVERSION exists.
...
> The idea behind shipping Debian's kernel package rather than my own
> is that I don't want my users to be left stranded with an out of
> date kernel should I die in a tragic blimp accident.
>
> Here's a (somewhat untested in this iteration) patch:
>
> ---
> diff --git a/u-boot-update b/u-boot-update
> index 69da211..e5ffb22 100755
> --- a/u-boot-update
> +++ b/u-boot-update
> @@ -182,7 +182,10 @@ do
>       else
>               _INITRD=""
>       fi
> -     if [ -e "${_BOOT_PATH}${U_BOOT_FDT_DIR}${_VERSION}/${U_BOOT_FDT}" ] && 
> [ -n "${U_BOOT_FDT}" ]
> +     if [ -e ${U_BOOT_FDT} ] && [ -n "${U_BOOT_FDT}" ] && [ "/" = $(echo 
> "${U_BOOT_FDT}" | head -c1) ]

Should have quotes consistently:
  
    if [ -e "${U_BOOT_FDT}" ] ...

> +     then
> +             _FDT="fdt ${U_BOOT_FDT}"
> +     elif [ -e "${_BOOT_PATH}${U_BOOT_FDT_DIR}${_VERSION}/${U_BOOT_FDT}" ] 
> && [ -n "${U_BOOT_FDT}" ]
>       then
>               _FDT="fdt ${U_BOOT_FDT_DIR}${_VERSION}/${U_BOOT_FDT}"
>       elif [ -d "${_BOOT_PATH}${U_BOOT_FDT_DIR}${_VERSION}/" ]

The patch works for me, both with and without U_BOOT_FDT
specified... e.g. it doesn't break default behavior.

Only thing missing is a commit message for the patch. :)

Would love to push it and get a new version uploaded soon!

live well,
  vagrant

Attachment: signature.asc
Description: PGP signature

Reply via email to