Re: [PATCH v4] mvebu: add support for iEi Puzzle-M901/Puzzle-M902

2021-07-14 Thread Daniel Golle
Hi Ian,

the patch looks good to me now, however, it doesn't apply:

Applying: mvebu: add support for iEi Puzzle-M901/Puzzle-M902
error: corrupt patch at line 433
Patch failed at 0001 mvebu: add support for iEi Puzzle-M901/Puzzle-M902
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

When trying to apply it manually outside of git, I also doesn'y apply:

checking file target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network
Hunk #1 succeeded at 10 (offset -1 lines).
checking file target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc.sh
checking file target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh
checking file 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9131-puzzle-m901.dts
patch:  malformed patch at line 433: diff --git 
a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts 
b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts

Please fix the patch so it applies cleanly.
I can't see obvious causes for this, linebreaks and such seem alright.

Try sending it again directly with 'git-send-email'.


Cheers


Daniel

On Wed, Jul 07, 2021 at 07:30:20PM +0800, eveans2...@gmail.com wrote:
> From: Ian Chang 
> 
>  Hardware specification
>  --
>  * CN9130 SoC, Quad-core ARMv8 Cortex-72 @ 2200 MHz
>  * 4 GB DDR
>  * 4 GB eMMC
>  * mmcblk0
> - mmcblk0p164M  kernel_1
> - mmcblk0p264M  kernel_2
> - mmcblk0p3   512M  rootfs_1
> - mmcblk0p4   512M  rootfs_2
> - mmcblk0p5   512M  Reserved
> - mmcblk0p664M  Reserved
> - mmcblk0p7   1.8G  rootfs_data
> 
>  * 4 MB (SPI Flash)
>  * 6 x 2.5 Gigabit  ports (Puzzle-M901)
> - External PHY with 6 ports (AQR112R)
>  * 6 x 2.5 Gigabit ports (Puzzle-M902)
> - External PHY with 6 ports (AQR112R)
>3 x 10 Gigabit ports (Puzzle-M902)
> - External PHY with 3 ports (AQR113R)
> 
>  * 4 x Front panel LED
>  * 1 x USB 3.0
>  * Reset button on Rear panel
>  * UART (115200 8N1,header on PCB)
> 
>  Flash instructions:
>   The original firmware is based on OpenWrt.
>   Flash firmware using LuCI and CLI
> 
> Signed-off-by: Ian Chang 
> ---
>  .../base-files/etc/board.d/02_network |   6 +
>  .../cortexa72/base-files/lib/upgrade/emmc.sh  |  36 ++
>  .../base-files/lib/upgrade/platform.sh|   8 +
>  .../boot/dts/marvell/cn9131-puzzle-m901.dts   | 326 
>  .../boot/dts/marvell/cn9132-puzzle-m902.dts   | 491 ++
>  target/linux/mvebu/image/cortexa72.mk |  18 +
>  ...l-Add-support-for-Marvell-CN9130-SoC.patch |  61 +++
>  7 files changed, 946 insertions(+)
>  create mode 100644 
> target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc.sh
>  create mode 100644 
> target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9131-puzzle-m901.dts
>  create mode 100644 
> target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts
>  create mode 100644 
> target/linux/mvebu/patches-5.4/000-v5.5-arm64-dts-marvell-Add-support-for-Marvell-CN9130-SoC.patch
> 
> diff --git a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network 
> b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network
> index 9ab3c8174d..e0a4bc3015 100755
> --- a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network
> +++ b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network
> @@ -11,6 +11,12 @@ board_config_update
>  board=$(board_name)
>  
>  case "$board" in
> +iei,puzzle-m901)
> + ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 eth5" "eth0"
> + ;;
> +iei,puzzle-m902)
> + ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 eth5 eth10 eth11 
> eth12" "eth0"
> + ;;
>  marvell,armada8040-mcbin-doubleshot|\
>  marvell,armada8040-mcbin-singleshot)
>   ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2"
> diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc.sh 
> b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc.sh
> new file mode 100644
> index 00..90ed7ae79a
> --- /dev/null
> +++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc.sh
> @@ -0,0 +1,36 @@
> +platform_do_upgrade_emmc() {
> + local board=$(board_name)
> + local diskdev partdev
> +
> + export_bootdevice && export_partdevice diskdev 0 || {
> + v "Unable to determine upgrade device"
> + return 1
> + }
> + sync
> + if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
> + get_partitions "/dev/$diskdev" bootdisk
> + v "Extract boot sector from the image"
> + get_image_dd "$1" of=/tmp/image.bs count=1 bs=512b
> + get_partitions /tmp/image.bs image
> + fi
> +
> + #iterate over each partition from the image and write it to the boot 
> disk
> + while read part start size; do
> + if export_partd

Missing files from package build by buildbot and no Phase 2 logs

2021-07-14 Thread Luiz Angelo Daros de Luca
Hello,

I'm trying to identify what caused
https://github.com/openwrt/packages/issues/16085.
If I build the package locally, I get everything in place. However,
the file built by buildbot is missing some files.

The command that would copy those is:

https://github.com/openwrt/packages/blob/69df02cabade31c19cec92252a564e354df44d75/utils/sane-backends/Makefile#L286-L289

using files generated by:

https://github.com/openwrt/packages/blob/69df02cabade31c19cec92252a564e354df44d75/utils/sane-backends/Makefile#L196-L202

It is probably something missing like awk/sort or sh compatibility.
However, I get no output from:
https://buildbot.openwrt.org/openwrt-21.02/packages/#/builders/12/builds/58/steps/24/logs/stdio

Is there any place to get full buildbot output for packages? Or an
easy way to locally simulate a buildbot?

Regards,

---
 Luiz Angelo Daros de Luca
luizl...@gmail.com

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


Re: [PATCH] ubus: add a private field to event handlers

2021-07-14 Thread Louis_Hampton
We use generated Rust bindings to libubus, and our own thread as opposed
to uloop. "container_of", quite aside from not being exported, violates
the strong types and memory safety rules we've previously been able to
uphold. This isn't an issue with callbacks from "ubus_invoke_fd", where
we can pass a pointer to some private (repr(C), for those who care) type
in "priv" and pick up context from that.

Since we don't have direct access to C macros at all, container_of is
far from ideal. This is the first instance where it has been required.

Do C++ libubus users make use of "container_of"?

~ Louis

Felix Fietkau writes:

> On 2021-07-13 13:57, louis_hamp...@sercomm.com wrote:
>> 
>> This is particularly useful in multithreaded non-C FFI, where
>> additional context from where the event handler was registered may be
>> critical to ensuring the output of the event is sent to the right
>> location.
>> 
>> Signed-off-by: Louis Hampton 
> In order to get the additional context, the normal solution is to embed
> struct ubus_event_handler into another data structure, which contains
> the extra context and can be accessed via container_of.
> Is there a reason why this can't be done in your code as well?
>
> - Felix


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


Re: [PATCH] ubus: add a private field to event handlers

2021-07-14 Thread Felix Fietkau
On 2021-07-13 13:57, louis_hamp...@sercomm.com wrote:
> 
> This is particularly useful in multithreaded non-C FFI, where
> additional context from where the event handler was registered may be
> critical to ensuring the output of the event is sent to the right
> location.
> 
> Signed-off-by: Louis Hampton 
In order to get the additional context, the normal solution is to embed
struct ubus_event_handler into another data structure, which contains
the extra context and can be accessed via container_of.
Is there a reason why this can't be done in your code as well?

- Felix

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