Hi,

W dniu 04.03.2019 o 18:43, Petr Štetiar pisze:
> Tomasz Maciej Nowak <tome...@o2.pl> [2019-03-04 15:18:06]:
> 
> Hi,
> 
>> -routerstation_do_upgrade() {
>> +redboot_fis_do_upgrade() {
>>      local append
>>      local sysup_file="$1"
>>      local magic=$(get_magic_word "$sysup_file")
>> @@ -15,7 +15,7 @@ routerstation_do_upgrade() {
>>  
>>              [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j 
>> $CONF_TAR"
>>              dd if="$sysup_file" bs=64k skip=1 2>/dev/null | \
>> -                    mtd -r $append -Fkernel:$kern_length:0x80060000,rootfs 
>> write - kernel:rootfs
>> +                    mtd -r $append 
>> -F$CI_KERNPART:$kern_length:0x80060000,rootfs write - $KERNPART:rootfs
> 
> instead of passing CI_KERNPART as global variable, wouldn't it be better to
> pass CI_KERNPART as 2nd argument to this function? Something like this:

I just followed an example like in:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
this is how all other targets pass additional options. Changing this is 
possible, but I would like to keep it consistent with other implementations.

> 
>> +    jjplus,ja76pf2)
>> +            redboot_fis_do_upgrade "$ARGV" "linux"
>>      ubnt,routerstation-pro)
>> -            routerstation_do_upgrade "$ARGV"
>> +            redboot_fis_do_upgrade "$ARGV" "kernel"
> 
>> +  IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | 
>> check-size $$$$(IMAGE_SIZE)
>> +#  IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | check-size 
>> $$$$(IMAGE_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
> 
> Why is this commented line needed? It's also in your ` ath79: routerstation: 
> prepare to use sysupgrade-tar format image` patch.

It's not needed per se, but as stated in the commit You are mentioning, I want 
to move to different image format and that is how new image recipe should look 
like, it is also easier for a person which want test the transition, without 
figuring out how the new image is generated. I plan to send patch to switch to 
switch the recipes after new stable OpenWrt version. But if that is unneeded 
cruft, I'll prepare another patch.

> 
>> new file mode 100644
>> index 0000000000..cd41e7ceb2
>> --- /dev/null
>> +++ b/target/linux/ath79/patches-4.14/408-mtd-redboot_partition_scan.patch
>> +--- a/drivers/mtd/redboot.c
>> ++++ b/drivers/mtd/redboot.c
> ...
>> +    if (i == numslots) {
>> +            /* Didn't find it */
>> ++           if (offset + master->erasesize < master->size) {
>> ++                   /* not at the end of the flash yet, maybe next block :) 
>> */
>> ++                   directory++;
>> ++                   goto restart;
>> ++           }
> 
> I'm wondering if this patch could be upstreamed first, so we don't need to 
> drag it around forever.

Yes, that would be preferred, but given my lack of skills and understanding in 
that regard (no programming skills), I don't see that accepted. But I could 
always test new patch iterations and ad my t-b if someone would be up to this 
task.

> 
> -- ynezz
> 

Regards

-- 
TMN

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to