Salut, Oui c'est exact, j'ai essayé de build en suivant le tuto de upnatom sur dslforums, il manquait des dossiers pour le fichier patch et sa a fini en erreur
si, quand tu rebuildera openwrt, tu peut vite fais prendre le temps de noter la procédure, je serai preneur !!
Merci !
Hello.
J'utilise la procédure bourrine: je recompile toujours tout pour une target. J'ai la flemme de chercher comment faire pour recompiler juste ce que l'on veut, avec le patch à nous, tout ça. Je ne connais pas assez le build d'openwrt pour chercher à faire une intégration propre.
Du coup ma méthode - je commence par un build officiel clean:
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git checkout v22.03.0 -b v22.03.0
wget https://downloads.openwrt.org/releases/22.03.0/targets/x86/64/feeds.buildinfo -O feeds.conf.default
./scripts/feeds update -a
./scripts/feeds install -a
wget https://downloads.openwrt.org/releases/22.03.0/targets/x86/64/config.buildinfo -O .config
make menuconfig
Là j'ai vu qu'il y avait un problème pour récupérer les sources de xxd. Du coup j'utilises le premier patch crados (changer un http en https, alors que le patch officiel utilise un xxd en perl):
diff --git a/tools/xxd/Makefile b/tools/xxd/Makefile
index c3cc6863cc..25d5bb6549 100644
--- a/tools/xxd/Makefile
+++ b/tools/xxd/Makefile
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=xxd
PKG_VERSION:=1.10
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://grail.cba.csuohio.edu/~somos/
+PKG_SOURCE_URL:=https://grail.cba.csuohio.edu/~somos/
PKG_HASH:=9bf05c19b9084973e3cc877696a7f9881a5c87fa5a9fa438d9962519726559f9
PKG_CPE_ID:=cpe:/a:vim:vim
Puis je compile tout une première fois:
make -j $(($(nproc)+1)) download world
Après, j'applique le patch. Je n'ai pas chercher à savoir sur quel version du code j'applique le patch: je l'applique partout:
find -name "bnx2x_link.c"
./build_dir/target-x86_64_musl/linux-x86_64/linux-5.10.138/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
./build_dir/toolchain-x86_64_gcc-11.2.0_musl/linux-5.10.138/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
cd ./build_dir/target-x86_64_musl/linux-x86_64/linux-5.10.138/
patch -p0 < ~/patch/bnx2x_warpcore+8727_2_5g_sgmii.patch
cd ./build_dir/toolchain-x86_64_gcc-11.2.0_musl/linux-5.10.138/
patch -p0 < ~/patch/bnx2x_warpcore+8727_2_5g_sgmii.patch
Cela a appliqué le patch, puis je rebuild de nouveau avec un simple make world. Et HOP, un package bnx2x qui tiens les 2Gbits.
Pour le patch, il ne me reste plus que ça:
diff bnx2x_link.c bnx2x_link2.c
153a154
> #define SFP_EEPROM_CON_TYPE_VAL_SC 0x1
4212a4214,4223
> /* Note that 2.5G works only when used with 1G advertisment */
> if (fiber_mode && (phy->req_line_speed == SPEED_2500) &&
> (phy->speed_cap_mask &
> (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G |
> PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))) {
> bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
> MDIO_WC_REG_SERDESDIGITAL_MISC1,
> 0x6010);
> }
>
4222a4234
> case SPEED_2500:
8174a8187
> case SFP_EEPROM_CON_TYPE_VAL_SC:
8185c8198,8199
< if (phy->req_line_speed != SPEED_1000) {
---
> if ((phy->req_line_speed != SPEED_1000) &&
> (phy->req_line_speed != SPEED_2500)) {
9238a9253
> (phy->req_line_speed == SPEED_2500) ||
9247a9263,9278
> if ((phy->req_line_speed == SPEED_2500) &&
> (phy->speed_cap_mask &
> (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G |
> PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))) {
> bnx2x_cl45_read_and_write(bp, phy,
> MDIO_AN_DEVAD,
> MDIO_AN_REG_8727_MISC_CTRL2,
> ~(1<<5));
> bnx2x_cl45_write(bp, phy,
> MDIO_AN_DEVAD,
> MDIO_AN_REG_8727_MISC_CTRL1, 0x0010);
> } else {
> bnx2x_cl45_write(bp, phy,
> MDIO_AN_DEVAD,
> MDIO_AN_REG_8727_MISC_CTRL1, 0x001C);
> }
9269c9300
< MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL, 0);
---
> MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL2, 0);
9277c9308
< MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL,
---
> MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL2,
9279a9311,9313
> MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL1,
> 0x001C);
> bnx2x_cl45_write(bp, phy,
9567a9602,9606
> } else if ((link_status & (1<<1)) && (!(link_status & (1<<14)))) {
> link_up = 1;
> vars->line_speed = SPEED_2500;
> DP(NETIF_MSG_LINK, "port %x: External link up in 2.5G\n",
> params->port);
9599c9638,9639
< (phy->req_line_speed == SPEED_1000)) {
---
> ((phy->req_line_speed == SPEED_1000) ||
> (phy->req_line_speed == SPEED_2500))) {
11722a11763
> SUPPORTED_2500baseX_Full |
11908a11950
> SUPPORTED_2500baseX_Full |
12255a12298
> SUPPORTED_2500baseX_Full |
Et voilà le résultat:
$ iperf3 -R -4 -c bouygues.testdebit.info -p 9219 -C bbr
Connecting to host bouygues.testdebit.info, port 9219
Reverse mode, remote host bouygues.testdebit.info is sending
[ 5] local AAAA port 58218 connected to 89.84.1.186 port 9219
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 245 MBytes 2.06 Gbits/sec
[ 5] 1.00-2.00 sec 253 MBytes 2.13 Gbits/sec
[ 5] 2.00-3.00 sec 254 MBytes 2.13 Gbits/sec
[ 5] 3.00-4.00 sec 256 MBytes 2.15 Gbits/sec
[ 5] 4.00-5.00 sec 259 MBytes 2.17 Gbits/sec
[ 5] 5.00-6.00 sec 257 MBytes 2.16 Gbits/sec
[ 5] 6.00-7.00 sec 260 MBytes 2.18 Gbits/sec
[ 5] 7.00-8.00 sec 260 MBytes 2.18 Gbits/sec
[ 5] 8.00-9.00 sec 258 MBytes 2.16 Gbits/sec
[ 5] 9.00-10.00 sec 259 MBytes 2.17 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 2.51 GBytes 2.16 Gbits/sec 0 sender
[ 5] 0.00-10.00 sec 2.50 GBytes 2.15 Gbits/sec receiver
iperf Done.
Du coup je joins le fichier résultat.