diff mbox

[OpenWrt-Devel,RFC,10/10] ipq806x: wrap ubi in itb

Message ID 1440155859-910-11-git-send-email-jogo@openwrt.org
State RFC
Headers show

Commit Message

Jonas Gorski Aug. 21, 2015, 11:17 a.m. UTC
The stock QSDK expects the ubi to be wrapped in an itb image, so
provide one for easy sysupgrade from QSDK.

FIXME: currently does not work? Seems to flash fine, but ubi cannot
be mounted by OpenWrt and needs to be flashed a second time.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 target/linux/ipq806x/image/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

John Crispin Aug. 21, 2015, 11:24 a.m. UTC | #1
On 21/08/2015 13:17, Jonas Gorski wrote:
> The stock QSDK expects the ubi to be wrapped in an itb image, so
> provide one for easy sysupgrade from QSDK.
> 
> FIXME: currently does not work? Seems to flash fine, but ubi cannot
> be mounted by OpenWrt and needs to be flashed a second time.

how do you flash it the second time ? using the same process ?

> 
> Signed-off-by: Jonas Gorski <jogo@openwrt.org>
> ---
>  target/linux/ipq806x/image/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
> index ac0fc84..2fdaab5 100644
> --- a/target/linux/ipq806x/image/Makefile
> +++ b/target/linux/ipq806x/image/Makefile
> @@ -53,8 +53,8 @@ endef
>  
>  define Device/UbiFit
>  	KERNEL_IN_UBI := 1
> -	IMAGES := nand-factory.ubi nand-sysupgrade.tar
> -	IMAGE/nand-factory.ubi := append-ubi
> +	IMAGES := nand-factory.itb nand-sysupgrade.tar
> +	IMAGE/nand-factory.itb := append-ubi | ubi-fit
>  	IMAGE/nand-sysupgrade.tar := sysupgrade-nand
>  endef
>  
>
Jonas Gorski Aug. 21, 2015, 11:28 a.m. UTC | #2
On 21.08.2015 13:24, John Crispin wrote:
> 
> 
> On 21/08/2015 13:17, Jonas Gorski wrote:
>> The stock QSDK expects the ubi to be wrapped in an itb image, so
>> provide one for easy sysupgrade from QSDK.
>>
>> FIXME: currently does not work? Seems to flash fine, but ubi cannot
>> be mounted by OpenWrt and needs to be flashed a second time.
> 
> how do you flash it the second time ? using the same process ?

Booted a ramdisk OpenWrt kernel, then flashed the ubi with ubiformat. Which didn't seem to differ from what the preinstalled QSDK did, but somehow works.

Jonas
John Crispin Aug. 21, 2015, 11:39 a.m. UTC | #3
On 21/08/2015 13:28, Jonas Gorski wrote:
> On 21.08.2015 13:24, John Crispin wrote:
>>
>>
>> On 21/08/2015 13:17, Jonas Gorski wrote:
>>> The stock QSDK expects the ubi to be wrapped in an itb image, so
>>> provide one for easy sysupgrade from QSDK.
>>>
>>> FIXME: currently does not work? Seems to flash fine, but ubi cannot
>>> be mounted by OpenWrt and needs to be flashed a second time.
>>
>> how do you flash it the second time ? using the same process ?
> 
> Booted a ramdisk OpenWrt kernel, then flashed the ubi with ubiformat. Which didn't seem to differ from what the preinstalled QSDK did, but somehow works.
> 
> Jonas
> 

does sysupgrade work from owrt->owrt ?
Jonas Gorski Aug. 21, 2015, 11:43 a.m. UTC | #4
On 21.08.2015 13:39, John Crispin wrote:
> 
> 
> On 21/08/2015 13:28, Jonas Gorski wrote:
>> On 21.08.2015 13:24, John Crispin wrote:
>>>
>>>
>>> On 21/08/2015 13:17, Jonas Gorski wrote:
>>>> The stock QSDK expects the ubi to be wrapped in an itb image, so
>>>> provide one for easy sysupgrade from QSDK.
>>>>
>>>> FIXME: currently does not work? Seems to flash fine, but ubi cannot
>>>> be mounted by OpenWrt and needs to be flashed a second time.
>>>
>>> how do you flash it the second time ? using the same process ?
>>
>> Booted a ramdisk OpenWrt kernel, then flashed the ubi with ubiformat. Which didn't seem to differ from what the preinstalled QSDK did, but somehow works.
>>
>> Jonas
>>
> 
> does sysupgrade work from owrt->owrt ?

Yes, even without the last two patches. The last two are only for "easy" sysupgrade from QSDK (in theory). Therefore also as RFC.


Jonas
Matthew McClintock Oct. 30, 2015, 7:48 p.m. UTC | #5
On 8/21/15, 6:43 AM, "openwrt-devel on behalf of Jonas Gorski" <openwrt-devel-bounces@lists.openwrt.org on behalf of jogo@openwrt.org> wrote:

> On 21.08.2015 13:39, John Crispin wrote:
>> 
>> 
>> On 21/08/2015 13:28, Jonas Gorski wrote:
>>> On 21.08.2015 13:24, John Crispin wrote:
>>>> 
>>>> 
>>>> On 21/08/2015 13:17, Jonas Gorski wrote:
>>>>> The stock QSDK expects the ubi to be wrapped in an itb image, so
>>>>> provide one for easy sysupgrade from QSDK.
>>>>> 
>>>>> FIXME: currently does not work? Seems to flash fine, but ubi cannot
>>>>> be mounted by OpenWrt and needs to be flashed a second time.
>>>> 
>>>> how do you flash it the second time ? using the same process ?
>>> 
>>> Booted a ramdisk OpenWrt kernel, then flashed the ubi with ubiformat. Which didn't seem to differ from what the preinstalled QSDK did, but somehow works.
>>> 
>>> Jonas
>>> 
>> 
>> does sysupgrade work from owrt->owrt ?
> 
> Yes, even without the last two patches. The last two are only for "easy" sysupgrade from QSDK (in theory). Therefore also as RFC.

The following patch is somehow causing the issue:

target/linux/generic/patches-3.18/494-mtd-ubi-add-EOF-marker-support.patch

Still investigating further.

[    3.295677] UBI: auto-attach mtd11
[    3.295698] UBI: attaching mtd11 to ubi0
[    3.334563] UBI: EOF marker found, PEBs from 29 will be erased
[    3.334725] UBI: scanning is finished
[    3.339293] UBI error: ubi_read_volume_table: the layout volume was not found
[    3.343386] UBI error: ubi_attach_mtd_dev: failed to attach mtd11, error -22
[    3.350150] UBI error: ubi_auto_attach: cannot attach mtd11

But with the above patch removed the board will boot when flashed from u-boot.

-M
diff mbox

Patch

diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index ac0fc84..2fdaab5 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -53,8 +53,8 @@  endef
 
 define Device/UbiFit
 	KERNEL_IN_UBI := 1
-	IMAGES := nand-factory.ubi nand-sysupgrade.tar
-	IMAGE/nand-factory.ubi := append-ubi
+	IMAGES := nand-factory.itb nand-sysupgrade.tar
+	IMAGE/nand-factory.itb := append-ubi | ubi-fit
 	IMAGE/nand-sysupgrade.tar := sysupgrade-nand
 endef