diff mbox series

[2/3] package: Add new fip package

Message ID 20200707075339.389528-3-mylene.josserand@collabora.com
State Changes Requested
Headers show
Series board: Add support for LePotato | expand

Commit Message

Mylene Josserand July 7, 2020, 7:53 a.m. UTC
Firmware Image Pacakge (FIP) is used to sign Amlogic u-boot binaries.
It is a host package as it is only binaries to call on u-boot image
to sign it. One tool is a python script that needs to be called with
'python' command, otherwise, it is not working. That is why there is
a dependency on host-python.

For the moment, only LePotato's board is supported. Other ones
may be added later, if needed.

Signed-off-by: Mylène Josserand <mylene.josserand@collabora.com>
---
 package/Config.in.host     |  1 +
 package/fip/Config.in.host | 17 +++++++++++++++++
 package/fip/fip.hash       |  2 ++
 package/fip/fip.mk         | 30 ++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 100644 package/fip/Config.in.host
 create mode 100644 package/fip/fip.hash
 create mode 100644 package/fip/fip.mk

Comments

Romain Naour July 7, 2020, 12:37 p.m. UTC | #1
Hi Mylène,

Le 07/07/2020 à 09:53, Mylène Josserand a écrit :
> Firmware Image Pacakge (FIP) is used to sign Amlogic u-boot binaries.
> It is a host package as it is only binaries to call on u-boot image
> to sign it. One tool is a python script that needs to be called with
> 'python' command, otherwise, it is not working. That is why there is
> a dependency on host-python.
> 
> For the moment, only LePotato's board is supported. Other ones
> may be added later, if needed.

We had a previous contribution about LePotato board from Baylibre [1].
There are several concerns about licensing, aml_encrypt_gxl and acs_tool.py.

What about gxlimg to replace aml_encrypt_gxl?

[1]
http://patchwork.ozlabs.org/project/buildroot/patch/1533545408-11248-2-git-send-email-narmstrong@baylibre.com/
[2] https://github.com/repk/gxlimg

Best regards,
Romain

> 
> Signed-off-by: Mylène Josserand <mylene.josserand@collabora.com>
> ---
>  package/Config.in.host     |  1 +
>  package/fip/Config.in.host | 17 +++++++++++++++++
>  package/fip/fip.hash       |  2 ++
>  package/fip/fip.mk         | 30 ++++++++++++++++++++++++++++++
>  4 files changed, 50 insertions(+)
>  create mode 100644 package/fip/Config.in.host
>  create mode 100644 package/fip/fip.hash
>  create mode 100644 package/fip/fip.mk
> 
> diff --git a/package/Config.in.host b/package/Config.in.host
> index f1246c708f..21d2bc4072 100644
> --- a/package/Config.in.host
> +++ b/package/Config.in.host
> @@ -24,6 +24,7 @@ menu "Host utilities"
>  	source "package/f2fs-tools/Config.in.host"
>  	source "package/faketime/Config.in.host"
>  	source "package/fatcat/Config.in.host"
> +	source "package/fip/Config.in.host"
>  	source "package/fwup/Config.in.host"
>  	source "package/genext2fs/Config.in.host"
>  	source "package/genimage/Config.in.host"
> diff --git a/package/fip/Config.in.host b/package/fip/Config.in.host
> new file mode 100644
> index 0000000000..914020a1b3
> --- /dev/null
> +++ b/package/fip/Config.in.host
> @@ -0,0 +1,17 @@
> +config BR2_PACKAGE_HOST_FIP
> +	bool "host Amlogic FIP binaries"
> +	help
> +	  This package contains the FIP utilities, that is
> +	  used to create U-Boot final binary.
> +
> +if BR2_PACKAGE_HOST_FIP
> +
> +config BR2_PACKAGE_HOST_FIP_LEPOTATO
> +	bool "FIP lepotato version"
> +	default y
> +	select BR2_PACKAGE_HOST_PYTHON3
> +	help
> +	  This option will download the latest libretech-cc's version
> +	  of the fip utility for the board "lepotato".
> +
> +endif
> diff --git a/package/fip/fip.hash b/package/fip/fip.hash
> new file mode 100644
> index 0000000000..547fff8534
> --- /dev/null
> +++ b/package/fip/fip.hash
> @@ -0,0 +1,2 @@
> +# Locally computed
> +sha256 7a59dc36c89b02c38f9b630b4abb7056869ff76ca6152b6c3ce797ddd1349a64  fip-bfdad4cc520b254813536ebfba8b9749386cd57c.tar.gz
> diff --git a/package/fip/fip.mk b/package/fip/fip.mk
> new file mode 100644
> index 0000000000..d1fb43ad13
> --- /dev/null
> +++ b/package/fip/fip.mk
> @@ -0,0 +1,30 @@
> +################################################################################
> +#
> +# fip
> +#
> +################################################################################
> +
> +FIP_VERSION = bfdad4cc520b254813536ebfba8b9749386cd57c
> +FIP_SITE = $(call github,LibreELEC,amlogic-boot-fip,$(FIP_VERSION))
> +FIP_LICENSE = PROPRIETARY
> +FIP_DEPENDENCIES = host-python3
> +
> +ifeq ($(BR2_PACKAGE_HOST_FIP_LEPOTATO),y)
> +HOST_FIP_LEPOTATO_BINARIES += lepotato/bl2.bin lepotato/acs.bin \
> +			lepotato/bl21.bin lepotato/bl30.bin \
> +			lepotato/bl301.bin lepotato/bl31.img \
> +			lepotato/blx_fix.sh lepotato/acs_tool.py lepotato/aml_encrypt_gxl
> +endif
> +
> +define HOST_FIP_INSTALL_SUBDIR
> +	$(INSTALL) -m 0755 -d $(HOST_DIR)/usr/bin/fip/
> +endef
> +
> +define HOST_FIP_INSTALL_CMDS
> +	$(foreach b,$(HOST_FIP_LEPOTATO_BINARIES),
> +		$(INSTALL) -D -m 755 $(@D)/$(b) $(HOST_DIR)/usr/bin/fip/)
> +endef
> +
> +HOST_FIP_PRE_INSTALL_HOOKS += HOST_FIP_INSTALL_SUBDIR
> +
> +$(eval $(host-generic-package))
>
Mylene Josserand July 7, 2020, 2:18 p.m. UTC | #2
Hi Romain,

Thank you for the review!

On 7/7/20 2:37 PM, Romain Naour wrote:
> Hi Mylène,
> 
> Le 07/07/2020 à 09:53, Mylène Josserand a écrit :
>> Firmware Image Pacakge (FIP) is used to sign Amlogic u-boot binaries.
>> It is a host package as it is only binaries to call on u-boot image
>> to sign it. One tool is a python script that needs to be called with
>> 'python' command, otherwise, it is not working. That is why there is
>> a dependency on host-python.
>>
>> For the moment, only LePotato's board is supported. Other ones
>> may be added later, if needed.
> 
> We had a previous contribution about LePotato board from Baylibre [1].
> There are several concerns about licensing, aml_encrypt_gxl and acs_tool.py.

oh, indeed, I missed that one.

> 
> What about gxlimg to replace aml_encrypt_gxl?

Thanks for the link, I will try it, indeed but I guess my patches are 
lapsed because of these license issues, right?

> 
> [1]
> http://patchwork.ozlabs.org/project/buildroot/patch/1533545408-11248-2-git-send-email-narmstrong@baylibre.com/
> [2] https://github.com/repk/gxlimg
> 
> Best regards,
> Romain

Best regards,
Mylène

> 
>>
>> Signed-off-by: Mylène Josserand <mylene.josserand@collabora.com>
>> ---
>>   package/Config.in.host     |  1 +
>>   package/fip/Config.in.host | 17 +++++++++++++++++
>>   package/fip/fip.hash       |  2 ++
>>   package/fip/fip.mk         | 30 ++++++++++++++++++++++++++++++
>>   4 files changed, 50 insertions(+)
>>   create mode 100644 package/fip/Config.in.host
>>   create mode 100644 package/fip/fip.hash
>>   create mode 100644 package/fip/fip.mk
>>
>> diff --git a/package/Config.in.host b/package/Config.in.host
>> index f1246c708f..21d2bc4072 100644
>> --- a/package/Config.in.host
>> +++ b/package/Config.in.host
>> @@ -24,6 +24,7 @@ menu "Host utilities"
>>   	source "package/f2fs-tools/Config.in.host"
>>   	source "package/faketime/Config.in.host"
>>   	source "package/fatcat/Config.in.host"
>> +	source "package/fip/Config.in.host"
>>   	source "package/fwup/Config.in.host"
>>   	source "package/genext2fs/Config.in.host"
>>   	source "package/genimage/Config.in.host"
>> diff --git a/package/fip/Config.in.host b/package/fip/Config.in.host
>> new file mode 100644
>> index 0000000000..914020a1b3
>> --- /dev/null
>> +++ b/package/fip/Config.in.host
>> @@ -0,0 +1,17 @@
>> +config BR2_PACKAGE_HOST_FIP
>> +	bool "host Amlogic FIP binaries"
>> +	help
>> +	  This package contains the FIP utilities, that is
>> +	  used to create U-Boot final binary.
>> +
>> +if BR2_PACKAGE_HOST_FIP
>> +
>> +config BR2_PACKAGE_HOST_FIP_LEPOTATO
>> +	bool "FIP lepotato version"
>> +	default y
>> +	select BR2_PACKAGE_HOST_PYTHON3
>> +	help
>> +	  This option will download the latest libretech-cc's version
>> +	  of the fip utility for the board "lepotato".
>> +
>> +endif
>> diff --git a/package/fip/fip.hash b/package/fip/fip.hash
>> new file mode 100644
>> index 0000000000..547fff8534
>> --- /dev/null
>> +++ b/package/fip/fip.hash
>> @@ -0,0 +1,2 @@
>> +# Locally computed
>> +sha256 7a59dc36c89b02c38f9b630b4abb7056869ff76ca6152b6c3ce797ddd1349a64  fip-bfdad4cc520b254813536ebfba8b9749386cd57c.tar.gz
>> diff --git a/package/fip/fip.mk b/package/fip/fip.mk
>> new file mode 100644
>> index 0000000000..d1fb43ad13
>> --- /dev/null
>> +++ b/package/fip/fip.mk
>> @@ -0,0 +1,30 @@
>> +################################################################################
>> +#
>> +# fip
>> +#
>> +################################################################################
>> +
>> +FIP_VERSION = bfdad4cc520b254813536ebfba8b9749386cd57c
>> +FIP_SITE = $(call github,LibreELEC,amlogic-boot-fip,$(FIP_VERSION))
>> +FIP_LICENSE = PROPRIETARY
>> +FIP_DEPENDENCIES = host-python3
>> +
>> +ifeq ($(BR2_PACKAGE_HOST_FIP_LEPOTATO),y)
>> +HOST_FIP_LEPOTATO_BINARIES += lepotato/bl2.bin lepotato/acs.bin \
>> +			lepotato/bl21.bin lepotato/bl30.bin \
>> +			lepotato/bl301.bin lepotato/bl31.img \
>> +			lepotato/blx_fix.sh lepotato/acs_tool.py lepotato/aml_encrypt_gxl
>> +endif
>> +
>> +define HOST_FIP_INSTALL_SUBDIR
>> +	$(INSTALL) -m 0755 -d $(HOST_DIR)/usr/bin/fip/
>> +endef
>> +
>> +define HOST_FIP_INSTALL_CMDS
>> +	$(foreach b,$(HOST_FIP_LEPOTATO_BINARIES),
>> +		$(INSTALL) -D -m 755 $(@D)/$(b) $(HOST_DIR)/usr/bin/fip/)
>> +endef
>> +
>> +HOST_FIP_PRE_INSTALL_HOOKS += HOST_FIP_INSTALL_SUBDIR
>> +
>> +$(eval $(host-generic-package))
>>
>
Romain Naour July 7, 2020, 2:29 p.m. UTC | #3
Hi Mylène,

Le 07/07/2020 à 16:18, Mylene Josserand a écrit :
> Hi Romain,
> 
> Thank you for the review!

You're welcome.

> 
> On 7/7/20 2:37 PM, Romain Naour wrote:
>> Hi Mylène,
>>
>> Le 07/07/2020 à 09:53, Mylène Josserand a écrit :
>>> Firmware Image Pacakge (FIP) is used to sign Amlogic u-boot binaries.
>>> It is a host package as it is only binaries to call on u-boot image
>>> to sign it. One tool is a python script that needs to be called with
>>> 'python' command, otherwise, it is not working. That is why there is
>>> a dependency on host-python.
>>>
>>> For the moment, only LePotato's board is supported. Other ones
>>> may be added later, if needed.
>>
>> We had a previous contribution about LePotato board from Baylibre [1].
>> There are several concerns about licensing, aml_encrypt_gxl and acs_tool.py.
> 
> oh, indeed, I missed that one.

No problem, those patches date from August 2018.

> 
>>
>> What about gxlimg to replace aml_encrypt_gxl?
> 
> Thanks for the link, I will try it, indeed but I guess my patches are lapsed
> because of these license issues, right?

I'm afraid yes. LibreELEC doesn't provide any licensing information in their
repository. I'm not sure if we should use LibreELEC or Baylibre repository...

Best regards,
Romain

> 
>>
>> [1]
>> http://patchwork.ozlabs.org/project/buildroot/patch/1533545408-11248-2-git-send-email-narmstrong@baylibre.com/
>>
>> [2] https://github.com/repk/gxlimg
>>
>> Best regards,
>> Romain
> 
> Best regards,
> Mylène
> 
>>
>>>
>>> Signed-off-by: Mylène Josserand <mylene.josserand@collabora.com>
>>> ---
>>>   package/Config.in.host     |  1 +
>>>   package/fip/Config.in.host | 17 +++++++++++++++++
>>>   package/fip/fip.hash       |  2 ++
>>>   package/fip/fip.mk         | 30 ++++++++++++++++++++++++++++++
>>>   4 files changed, 50 insertions(+)
>>>   create mode 100644 package/fip/Config.in.host
>>>   create mode 100644 package/fip/fip.hash
>>>   create mode 100644 package/fip/fip.mk
>>>
>>> diff --git a/package/Config.in.host b/package/Config.in.host
>>> index f1246c708f..21d2bc4072 100644
>>> --- a/package/Config.in.host
>>> +++ b/package/Config.in.host
>>> @@ -24,6 +24,7 @@ menu "Host utilities"
>>>       source "package/f2fs-tools/Config.in.host"
>>>       source "package/faketime/Config.in.host"
>>>       source "package/fatcat/Config.in.host"
>>> +    source "package/fip/Config.in.host"
>>>       source "package/fwup/Config.in.host"
>>>       source "package/genext2fs/Config.in.host"
>>>       source "package/genimage/Config.in.host"
>>> diff --git a/package/fip/Config.in.host b/package/fip/Config.in.host
>>> new file mode 100644
>>> index 0000000000..914020a1b3
>>> --- /dev/null
>>> +++ b/package/fip/Config.in.host
>>> @@ -0,0 +1,17 @@
>>> +config BR2_PACKAGE_HOST_FIP
>>> +    bool "host Amlogic FIP binaries"
>>> +    help
>>> +      This package contains the FIP utilities, that is
>>> +      used to create U-Boot final binary.
>>> +
>>> +if BR2_PACKAGE_HOST_FIP
>>> +
>>> +config BR2_PACKAGE_HOST_FIP_LEPOTATO
>>> +    bool "FIP lepotato version"
>>> +    default y
>>> +    select BR2_PACKAGE_HOST_PYTHON3
>>> +    help
>>> +      This option will download the latest libretech-cc's version
>>> +      of the fip utility for the board "lepotato".
>>> +
>>> +endif
>>> diff --git a/package/fip/fip.hash b/package/fip/fip.hash
>>> new file mode 100644
>>> index 0000000000..547fff8534
>>> --- /dev/null
>>> +++ b/package/fip/fip.hash
>>> @@ -0,0 +1,2 @@
>>> +# Locally computed
>>> +sha256 7a59dc36c89b02c38f9b630b4abb7056869ff76ca6152b6c3ce797ddd1349a64 
>>> fip-bfdad4cc520b254813536ebfba8b9749386cd57c.tar.gz
>>> diff --git a/package/fip/fip.mk b/package/fip/fip.mk
>>> new file mode 100644
>>> index 0000000000..d1fb43ad13
>>> --- /dev/null
>>> +++ b/package/fip/fip.mk
>>> @@ -0,0 +1,30 @@
>>> +################################################################################
>>>
>>> +#
>>> +# fip
>>> +#
>>> +################################################################################
>>>
>>> +
>>> +FIP_VERSION = bfdad4cc520b254813536ebfba8b9749386cd57c
>>> +FIP_SITE = $(call github,LibreELEC,amlogic-boot-fip,$(FIP_VERSION))
>>> +FIP_LICENSE = PROPRIETARY
>>> +FIP_DEPENDENCIES = host-python3
>>> +
>>> +ifeq ($(BR2_PACKAGE_HOST_FIP_LEPOTATO),y)
>>> +HOST_FIP_LEPOTATO_BINARIES += lepotato/bl2.bin lepotato/acs.bin \
>>> +            lepotato/bl21.bin lepotato/bl30.bin \
>>> +            lepotato/bl301.bin lepotato/bl31.img \
>>> +            lepotato/blx_fix.sh lepotato/acs_tool.py lepotato/aml_encrypt_gxl
>>> +endif
>>> +
>>> +define HOST_FIP_INSTALL_SUBDIR
>>> +    $(INSTALL) -m 0755 -d $(HOST_DIR)/usr/bin/fip/
>>> +endef
>>> +
>>> +define HOST_FIP_INSTALL_CMDS
>>> +    $(foreach b,$(HOST_FIP_LEPOTATO_BINARIES),
>>> +        $(INSTALL) -D -m 755 $(@D)/$(b) $(HOST_DIR)/usr/bin/fip/)
>>> +endef
>>> +
>>> +HOST_FIP_PRE_INSTALL_HOOKS += HOST_FIP_INSTALL_SUBDIR
>>> +
>>> +$(eval $(host-generic-package))
>>>
>>
>
Mylene Josserand July 9, 2020, 11:51 a.m. UTC | #4
Hello,

On 7/7/20 4:29 PM, Romain Naour wrote:
> Hi Mylène,
> 
> Le 07/07/2020 à 16:18, Mylene Josserand a écrit :
>> Hi Romain,
>>
>> Thank you for the review!
> 
> You're welcome.
> 
>>
>> On 7/7/20 2:37 PM, Romain Naour wrote:
>>> Hi Mylène,
>>>
>>> Le 07/07/2020 à 09:53, Mylène Josserand a écrit :
>>>> Firmware Image Pacakge (FIP) is used to sign Amlogic u-boot binaries.
>>>> It is a host package as it is only binaries to call on u-boot image
>>>> to sign it. One tool is a python script that needs to be called with
>>>> 'python' command, otherwise, it is not working. That is why there is
>>>> a dependency on host-python.
>>>>
>>>> For the moment, only LePotato's board is supported. Other ones
>>>> may be added later, if needed.
>>>
>>> We had a previous contribution about LePotato board from Baylibre [1].
>>> There are several concerns about licensing, aml_encrypt_gxl and acs_tool.py.
>>
>> oh, indeed, I missed that one.
> 
> No problem, those patches date from August 2018.
> 
>>
>>>
>>> What about gxlimg to replace aml_encrypt_gxl?
>>
>> Thanks for the link, I will try it, indeed but I guess my patches are lapsed
>> because of these license issues, right?
> 
> I'm afraid yes. LibreELEC doesn't provide any licensing information in their
> repository. I'm not sure if we should use LibreELEC or Baylibre repository...

okay, thank you

Yes, I am not sure too, I thought that LibreElec was more appropriate 
but without any conviction :)

Best regards,
Mylène

> 
> Best regards,
> Romain
> 
>>
>>>
>>> [1]
>>> http://patchwork.ozlabs.org/project/buildroot/patch/1533545408-11248-2-git-send-email-narmstrong@baylibre.com/
>>>
>>> [2] https://github.com/repk/gxlimg
>>>
>>> Best regards,
>>> Romain
>>
>> Best regards,
>> Mylène
>>
>>>
>>>>
>>>> Signed-off-by: Mylène Josserand <mylene.josserand@collabora.com>
>>>> ---
>>>>    package/Config.in.host     |  1 +
>>>>    package/fip/Config.in.host | 17 +++++++++++++++++
>>>>    package/fip/fip.hash       |  2 ++
>>>>    package/fip/fip.mk         | 30 ++++++++++++++++++++++++++++++
>>>>    4 files changed, 50 insertions(+)
>>>>    create mode 100644 package/fip/Config.in.host
>>>>    create mode 100644 package/fip/fip.hash
>>>>    create mode 100644 package/fip/fip.mk
>>>>
>>>> diff --git a/package/Config.in.host b/package/Config.in.host
>>>> index f1246c708f..21d2bc4072 100644
>>>> --- a/package/Config.in.host
>>>> +++ b/package/Config.in.host
>>>> @@ -24,6 +24,7 @@ menu "Host utilities"
>>>>        source "package/f2fs-tools/Config.in.host"
>>>>        source "package/faketime/Config.in.host"
>>>>        source "package/fatcat/Config.in.host"
>>>> +    source "package/fip/Config.in.host"
>>>>        source "package/fwup/Config.in.host"
>>>>        source "package/genext2fs/Config.in.host"
>>>>        source "package/genimage/Config.in.host"
>>>> diff --git a/package/fip/Config.in.host b/package/fip/Config.in.host
>>>> new file mode 100644
>>>> index 0000000000..914020a1b3
>>>> --- /dev/null
>>>> +++ b/package/fip/Config.in.host
>>>> @@ -0,0 +1,17 @@
>>>> +config BR2_PACKAGE_HOST_FIP
>>>> +    bool "host Amlogic FIP binaries"
>>>> +    help
>>>> +      This package contains the FIP utilities, that is
>>>> +      used to create U-Boot final binary.
>>>> +
>>>> +if BR2_PACKAGE_HOST_FIP
>>>> +
>>>> +config BR2_PACKAGE_HOST_FIP_LEPOTATO
>>>> +    bool "FIP lepotato version"
>>>> +    default y
>>>> +    select BR2_PACKAGE_HOST_PYTHON3
>>>> +    help
>>>> +      This option will download the latest libretech-cc's version
>>>> +      of the fip utility for the board "lepotato".
>>>> +
>>>> +endif
>>>> diff --git a/package/fip/fip.hash b/package/fip/fip.hash
>>>> new file mode 100644
>>>> index 0000000000..547fff8534
>>>> --- /dev/null
>>>> +++ b/package/fip/fip.hash
>>>> @@ -0,0 +1,2 @@
>>>> +# Locally computed
>>>> +sha256 7a59dc36c89b02c38f9b630b4abb7056869ff76ca6152b6c3ce797ddd1349a64
>>>> fip-bfdad4cc520b254813536ebfba8b9749386cd57c.tar.gz
>>>> diff --git a/package/fip/fip.mk b/package/fip/fip.mk
>>>> new file mode 100644
>>>> index 0000000000..d1fb43ad13
>>>> --- /dev/null
>>>> +++ b/package/fip/fip.mk
>>>> @@ -0,0 +1,30 @@
>>>> +################################################################################
>>>>
>>>> +#
>>>> +# fip
>>>> +#
>>>> +################################################################################
>>>>
>>>> +
>>>> +FIP_VERSION = bfdad4cc520b254813536ebfba8b9749386cd57c
>>>> +FIP_SITE = $(call github,LibreELEC,amlogic-boot-fip,$(FIP_VERSION))
>>>> +FIP_LICENSE = PROPRIETARY
>>>> +FIP_DEPENDENCIES = host-python3
>>>> +
>>>> +ifeq ($(BR2_PACKAGE_HOST_FIP_LEPOTATO),y)
>>>> +HOST_FIP_LEPOTATO_BINARIES += lepotato/bl2.bin lepotato/acs.bin \
>>>> +            lepotato/bl21.bin lepotato/bl30.bin \
>>>> +            lepotato/bl301.bin lepotato/bl31.img \
>>>> +            lepotato/blx_fix.sh lepotato/acs_tool.py lepotato/aml_encrypt_gxl
>>>> +endif
>>>> +
>>>> +define HOST_FIP_INSTALL_SUBDIR
>>>> +    $(INSTALL) -m 0755 -d $(HOST_DIR)/usr/bin/fip/
>>>> +endef
>>>> +
>>>> +define HOST_FIP_INSTALL_CMDS
>>>> +    $(foreach b,$(HOST_FIP_LEPOTATO_BINARIES),
>>>> +        $(INSTALL) -D -m 755 $(@D)/$(b) $(HOST_DIR)/usr/bin/fip/)
>>>> +endef
>>>> +
>>>> +HOST_FIP_PRE_INSTALL_HOOKS += HOST_FIP_INSTALL_SUBDIR
>>>> +
>>>> +$(eval $(host-generic-package))
>>>>
>>>
>>
>
diff mbox series

Patch

diff --git a/package/Config.in.host b/package/Config.in.host
index f1246c708f..21d2bc4072 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -24,6 +24,7 @@  menu "Host utilities"
 	source "package/f2fs-tools/Config.in.host"
 	source "package/faketime/Config.in.host"
 	source "package/fatcat/Config.in.host"
+	source "package/fip/Config.in.host"
 	source "package/fwup/Config.in.host"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
diff --git a/package/fip/Config.in.host b/package/fip/Config.in.host
new file mode 100644
index 0000000000..914020a1b3
--- /dev/null
+++ b/package/fip/Config.in.host
@@ -0,0 +1,17 @@ 
+config BR2_PACKAGE_HOST_FIP
+	bool "host Amlogic FIP binaries"
+	help
+	  This package contains the FIP utilities, that is
+	  used to create U-Boot final binary.
+
+if BR2_PACKAGE_HOST_FIP
+
+config BR2_PACKAGE_HOST_FIP_LEPOTATO
+	bool "FIP lepotato version"
+	default y
+	select BR2_PACKAGE_HOST_PYTHON3
+	help
+	  This option will download the latest libretech-cc's version
+	  of the fip utility for the board "lepotato".
+
+endif
diff --git a/package/fip/fip.hash b/package/fip/fip.hash
new file mode 100644
index 0000000000..547fff8534
--- /dev/null
+++ b/package/fip/fip.hash
@@ -0,0 +1,2 @@ 
+# Locally computed
+sha256 7a59dc36c89b02c38f9b630b4abb7056869ff76ca6152b6c3ce797ddd1349a64  fip-bfdad4cc520b254813536ebfba8b9749386cd57c.tar.gz
diff --git a/package/fip/fip.mk b/package/fip/fip.mk
new file mode 100644
index 0000000000..d1fb43ad13
--- /dev/null
+++ b/package/fip/fip.mk
@@ -0,0 +1,30 @@ 
+################################################################################
+#
+# fip
+#
+################################################################################
+
+FIP_VERSION = bfdad4cc520b254813536ebfba8b9749386cd57c
+FIP_SITE = $(call github,LibreELEC,amlogic-boot-fip,$(FIP_VERSION))
+FIP_LICENSE = PROPRIETARY
+FIP_DEPENDENCIES = host-python3
+
+ifeq ($(BR2_PACKAGE_HOST_FIP_LEPOTATO),y)
+HOST_FIP_LEPOTATO_BINARIES += lepotato/bl2.bin lepotato/acs.bin \
+			lepotato/bl21.bin lepotato/bl30.bin \
+			lepotato/bl301.bin lepotato/bl31.img \
+			lepotato/blx_fix.sh lepotato/acs_tool.py lepotato/aml_encrypt_gxl
+endif
+
+define HOST_FIP_INSTALL_SUBDIR
+	$(INSTALL) -m 0755 -d $(HOST_DIR)/usr/bin/fip/
+endef
+
+define HOST_FIP_INSTALL_CMDS
+	$(foreach b,$(HOST_FIP_LEPOTATO_BINARIES),
+		$(INSTALL) -D -m 755 $(@D)/$(b) $(HOST_DIR)/usr/bin/fip/)
+endef
+
+HOST_FIP_PRE_INSTALL_HOOKS += HOST_FIP_INSTALL_SUBDIR
+
+$(eval $(host-generic-package))