diff mbox

[OpenWrt-Devel,1/2] include: add a new ubinize-image build target

Message ID 1440120867-11871-1-git-send-email-mathieu@codeaurora.org
State Superseded
Headers show

Commit Message

Mathieu Olivari Aug. 21, 2015, 1:34 a.m. UTC
This new build target can be used to generate a ubinized.bin file,
including the kernel and the FS specified as an argument.

Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
---
 include/image.mk | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jonas Gorski Aug. 21, 2015, 9:49 a.m. UTC | #1
On Fri, Aug 21, 2015 at 3:34 AM, Mathieu Olivari <mathieu@codeaurora.org> wrote:
> This new build target can be used to generate a ubinized.bin file,
> including the kernel and the FS specified as an argument.
>
> Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>

I have a slightly different approach in my queue that uses
scripts/ubinize-image.sh which allows using per device block- and
pagesizes, and control whether the kernel should be included on a per
device basis. E.g. the Netgear R7500 has the kernel raw on the flash,
so the kernel should not be included there. I plan to push it today,
if that approach is okay with you.

I also have a buildstep for wrapping the ubi in a itb file so
qsdk-sysupgrade accepts it, but when I did this it seemed to flashed
correctly, and u-boot was able to load the kenrel, but openwrt then
failed to mount the on flash ubi. Unfortunately I forgot to backup the
original firmware, so I will need to free up some space for qsdk to
reproduce it. Sysupgrade from within OpenWrt is working fine though.


Jonas

> ---
>  include/image.mk | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/include/image.mk b/include/image.mk
> index 73fc805..f98d871 100644
> --- a/include/image.mk
> +++ b/include/image.mk
> @@ -380,6 +380,12 @@ define Build/combined-image
>         @mv $@.new $@
>  endef
>
> +define Build/ubinize-image
> +       $(if $(filter $(1),$(TARGET_FILESYSTEMS)), \
> +               $(call Image/Build/UbinizeImage,$(DEVICE_NAME),--kernel $(word 1,$^),$(1),$(UBINIZE_OPTS)); \
> +               cp $(KDIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-$(1)-ubinized.bin $@)
> +endef
> +
>  define Device/Init
>    PROFILES := $(PROFILE)
>    DEVICE_NAME := $(1)
> --
> 2.1.4
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
John Crispin Aug. 21, 2015, 10:44 a.m. UTC | #2
On 21/08/2015 11:49, Jonas Gorski wrote:
> On Fri, Aug 21, 2015 at 3:34 AM, Mathieu Olivari <mathieu@codeaurora.org> wrote:
>> This new build target can be used to generate a ubinized.bin file,
>> including the kernel and the FS specified as an argument.
>>
>> Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
> 
> I have a slightly different approach in my queue that uses
> scripts/ubinize-image.sh which allows using per device block- and
> pagesizes, and control whether the kernel should be included on a per
> device basis. E.g. the Netgear R7500 has the kernel raw on the flash,
> so the kernel should not be included there. I plan to push it today,
> if that approach is okay with you.
> 
> I also have a buildstep for wrapping the ubi in a itb file so
> qsdk-sysupgrade accepts it, but when I did this it seemed to flashed
> correctly, and u-boot was able to load the kenrel, but openwrt then
> failed to mount the on flash ubi. Unfortunately I forgot to backup the
> original firmware, so I will need to free up some space for qsdk to
> reproduce it. Sysupgrade from within OpenWrt is working fine though.
> 
> 

can you post your patches please ? i had already pulled these 2 into my
queue but am happy to drop them again in favour of a different solution

	John


> Jonas
> 
>> ---
>>  include/image.mk | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/include/image.mk b/include/image.mk
>> index 73fc805..f98d871 100644
>> --- a/include/image.mk
>> +++ b/include/image.mk
>> @@ -380,6 +380,12 @@ define Build/combined-image
>>         @mv $@.new $@
>>  endef
>>
>> +define Build/ubinize-image
>> +       $(if $(filter $(1),$(TARGET_FILESYSTEMS)), \
>> +               $(call Image/Build/UbinizeImage,$(DEVICE_NAME),--kernel $(word 1,$^),$(1),$(UBINIZE_OPTS)); \
>> +               cp $(KDIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-$(1)-ubinized.bin $@)
>> +endef
>> +
>>  define Device/Init
>>    PROFILES := $(PROFILE)
>>    DEVICE_NAME := $(1)
>> --
>> 2.1.4
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
diff mbox

Patch

diff --git a/include/image.mk b/include/image.mk
index 73fc805..f98d871 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -380,6 +380,12 @@  define Build/combined-image
 	@mv $@.new $@
 endef
 
+define Build/ubinize-image
+	$(if $(filter $(1),$(TARGET_FILESYSTEMS)), \
+		$(call Image/Build/UbinizeImage,$(DEVICE_NAME),--kernel $(word 1,$^),$(1),$(UBINIZE_OPTS)); \
+		cp $(KDIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-$(1)-ubinized.bin $@)
+endef
+
 define Device/Init
   PROFILES := $(PROFILE)
   DEVICE_NAME := $(1)