Re: [PATCH v2] scripts: create kernel configuration upgrade script

2024-02-13 Thread Elliott Mitchell
On Tue, Feb 06, 2024 at 05:16:41PM -0800, Elliott Mitchell wrote:
> Create a script for automating kernel version changes.  This
> generates a pair of commits which cause history to remain attached to
> all versioned configuration files.
> 
> Crucially this makes `git blame` work without needing
> --find-copies-harder, which is too slow for routine use.  This also
> updates *everything*, which greatly simplifies rebasing patches
> which effect multiple devices.

Seems I goofed and should have Cc'd Christian Marangi when sending this.

The script seems to work fine.  One remaining issue is whether any
adjustment to the commit messages on the generated commits is desired.
I'm unsure they need "Signed-off-by" since they're tool-generated.  I
also wonder whether the script should claim to be the author.

The one difference is this does all kernel configs in one pass.  This
seems superior as it makes rebasing proposed patches *much* simpler.
Specifically there is far less update work without continuously appearing
and disappearing configs.  This also means only a single commit per year
which troubles bisecting.


-- 
(\___(\___(\__  --=> 8-) EHM <=--  __/)___/)___/)
 \BS (| ehem+sig...@m5p.com  PGP 87145445 |)   /
  \_CS\   |  _  -O #include  O-   _  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445



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


[PATCH RFC] base-files: sysupgrade: always setup overlay when creating backup

2024-02-13 Thread Rafał Miłecki
From: Rafał Miłecki 

Setting overlay while creating backup allows including extra files in
archive without actually writing them to flash. Right now this feature
is limited to /etc/backup/ directory and is used only for including
installed_packages.txt.

Extend this solution to make it more generic:
1. Always mount overlay while creating backup
2. Overlay whole / to don't limit it to /etc/backup/

This allows including any additional files in backups and adding more
sysupgrade features.

Cc: Luiz Angelo Daros de Luca 
Cc: Christian Marangi 
Cc: Jo-Philipp Wich 
Cc: Jonas Gorski 
Signed-off-by: Rafał Miłecki 
---
This will allow me to include /etc/uci-defaults/ scripts in backups so
we can e.g. have script disabling previously disabled services.

 package/base-files/files/sbin/sysupgrade | 37 ++--
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/package/base-files/files/sbin/sysupgrade 
b/package/base-files/files/sbin/sysupgrade
index 1fcd44da2a..1e09f65e07 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -237,7 +237,8 @@ include /lib/upgrade
 create_backup_archive() {
local conf_tar="$1"
 
-   local umount_etcbackup_dir=0
+   local overlay
+   local dir
 
[ "$(rootfs_type)" = "tmpfs" ] && {
echo "Cannot save config while running from ramdisk." >&2
@@ -248,17 +249,20 @@ create_backup_archive() {
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
ask_bool 0 "Edit config file list" && vi "$CONFFILES"
 
+   # Mount root directory with temporary overlay on top of it.
+   # This allows including extra (temporary) files in backup archive
+   # without messing actual rootfs.
+   overlay="$(mktemp -d -t overlay.XX)"
+   mkdir -p "$overlay/upper" "$overlay/work"
+   dir="$(mktemp -d -t backup.XX)"
+   if ! mount -t overlay overlay -o 
lowerdir=/,upperdir="$overlay/upper",workdir="$overlay/work" "$dir"; then
+   echo "Cannot mount backup overlay to $dir." >&2
+   ask_bool 0 "Abort" && exit
+   fi
+
if [ "$SAVE_INSTALLED_PKGS" -eq 1 ]; then
echo "${INSTALLED_PACKAGES}" >> "$CONFFILES"
-   mkdir -p "$ETCBACKUP_DIR"
-   # Avoid touching filesystem on each backup
-   RAMFS="$(mktemp -d -t sysupgrade.XX)"
-   mkdir -p "$RAMFS/upper" "$RAMFS/work"
-   mount -t overlay overlay -o 
lowerdir=$ETCBACKUP_DIR,upperdir=$RAMFS/upper,workdir=$RAMFS/work 
$ETCBACKUP_DIR &&
-   umount_etcbackup_dir=1 || {
-   echo "Cannot mount '$ETCBACKUP_DIR' as tmpfs to 
avoid touching disk while saving the list of installed packages." >&2
-   ask_bool 0 "Abort" && exit
-   }
+   mkdir -p "$dir/$ETCBACKUP_DIR"
 
# Format: pkg-name{rom,overlay,unkown}
# rom is used for pkgs in /rom, even if updated later
@@ -266,22 +270,23 @@ create_backup_archive() {
\( -exec test -f /rom/{} \; -exec echo {} rom \; \) -o \
\( -exec test -f /overlay/upper/{} \; -exec echo {} 
overlay \; \) -o \
\( -exec echo {} unknown \; \) \
-   \) | sed -e 's,.*/,,;s/\.control /\t/' > 
${INSTALLED_PACKAGES}
+   \) | sed -e 's,.*/,,;s/\.control /\t/' > 
"$dir/${INSTALLED_PACKAGES}"
fi
 
v "Saving config files..."
+   sed -i 's/^\///' "$CONFFILES" # Drop leading slashes
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
-   tar c${TAR_V}zf "$conf_tar" -T "$CONFFILES" 2>/dev/null
+   tar c${TAR_V}zf "$conf_tar" -C "${dir:-/}" -T "$CONFFILES"
if [ "$?" -ne 0 ]; then
echo "Failed to create the configuration backup."
rm -f "$conf_tar"
exit 1
fi
 
-   [ "$umount_etcbackup_dir" -eq 1 ] && {
-   umount "$ETCBACKUP_DIR"
-   rm -rf "$RAMFS"
-   }
+   umount "$dir"
+   rm -rf "$dir"
+   rm -rf "$overlay"
+
rm -f "$CONFFILES"
 }
 
-- 
2.35.3


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


Re: ustream-ssl ABI_VERSION usage

2024-02-13 Thread Daniel Golle


On 13 February 2024 17:39:29 UTC, Paul Spooren  wrote:
>Hi,
>
>> On Feb 12, 2024, at 14:30, Petr Štetiar  wrote:
>> 
>> Jo-Philipp Wich  [2024-02-12 14:09:27]:
>> 
>> Hi,
>> 
>>> Ideally all packages specifying an ABI version should ship versioned .so 
>>> files
>>> as well.
>> 
>> I would like to point out, that ustream-ssl is dynamically loaded 
>> library[1], so we
>> would need to pass that ABI information somehow to the clients, so they would
>> be able to load correct/compatible version of dynlib, not exactly trivial.
>> 
>> 1. https://lxr.openwrt.org/source/uclient/uclient-fetch.c#L516
>
>Thank you both for the clarification. I thought that if opkg just isn’t smart 
>enough to figure ABI versions I cleanly solve it via apk, however if we really 
>want to handle parallel installations I’ll teach apk some new tricks.

Updates to libubox or other basic libs used by a lot of packages are the prime 
example. Having the ABIversion appended to the package name like we do for opkg 
nicely solves the problem, as in that way libubox12 can be installed in 
parallel with libubox14.
Not having that option would make selectively updating a system impossible, and 
imho thats bad because esp. on remote boxes l may not want to update everything 
just in order to update, lets say, umdns, which may be built against a newer 
version of libubox than what I'm running now and hence depends on that. When 
running on a space constraint box with overlayfs updating everything isn't even 
an option in practise due to jffs2 being to small to fit everything and things 
in squashfs rom cannot be replaced.


So loosing that (by turning around the provided vs. provider logic as Ariadne 
was suggesting to not need strippable ABIVersion info added) is really not a 
good option for OpenWrt I believe.

>
>Best,
>Paul

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


Re: ustream-ssl ABI_VERSION usage

2024-02-13 Thread Paul Spooren
Hi,

> On Feb 12, 2024, at 14:30, Petr Štetiar  wrote:
> 
> Jo-Philipp Wich  [2024-02-12 14:09:27]:
> 
> Hi,
> 
>> Ideally all packages specifying an ABI version should ship versioned .so 
>> files
>> as well.
> 
> I would like to point out, that ustream-ssl is dynamically loaded library[1], 
> so we
> would need to pass that ABI information somehow to the clients, so they would
> be able to load correct/compatible version of dynlib, not exactly trivial.
> 
> 1. https://lxr.openwrt.org/source/uclient/uclient-fetch.c#L516

Thank you both for the clarification. I thought that if opkg just isn’t smart 
enough to figure ABI versions I cleanly solve it via apk, however if we really 
want to handle parallel installations I’ll teach apk some new tricks.

Best,
Paul

signature.asc
Description: Message signed with OpenPGP
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: expat update broke build on ubuntu 22.04 server

2024-02-13 Thread nick

Can you try building from a clean build, e.g. use make distclean?

On 2/13/24 11:56, Koen Vandeputte wrote:

Hi Nick,

Regarding commit:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=4a3f430d726e0713f4936844f26ccaf5077ef881


I'm seeing this when building:
Any idea how to fix it?



checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -std=c++11... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with +std=c++11... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -h std=c++11... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -std:c++11... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -std=c++0x... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with +std=c++0x... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -h std=c++0x... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -std:c++0x... no
configure: error: *** A compiler with support for C++11 language
features is required.
make[3]: *** [Makefile:34:
/home/koen/firmware/builds/generic_dr40x9/build_dir/host/expat-2.6.0/.configured]
Error 1
make[3]: Leaving directory
'/home/koen/firmware/builds/generic_dr40x9/tools/expat'
time: tools/expat/compile#0.94#0.25#1.17
 ERROR: tools/expat failed to build.
make[2]: *** [tools/Makefile:228: tools/expat/compile] Error 1
make[2]: Leaving directory '/home/koen/firmware/builds/generic_dr40x9'
make[1]: *** [tools/Makefile:224:
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/stamp/.tools_compile_nyyynyynnnnynyyynyyynnynyynnynnyynyyynynnyyy]
Error 2
make[1]: Leaving directory '/home/koen/firmware/builds/generic_dr40x9'
make: *** [/home/koen/firmware/builds/generic_dr40x9/include/toplevel.mk:232:
world] Error 2


koen@roemer:~/firmware/builds/generic_dr40x9$ uname -a
Linux roemer 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC
2023 x86_64 x86_64 x86_64 GNU/Linux


koen@roemer:~/firmware/builds/generic_dr40x9$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Koen

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


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


expat update broke build on ubuntu 22.04 server

2024-02-13 Thread Koen Vandeputte
Hi Nick,

Regarding commit:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=4a3f430d726e0713f4936844f26ccaf5077ef881


I'm seeing this when building:
Any idea how to fix it?



checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -std=c++11... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with +std=c++11... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -h std=c++11... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -std:c++11... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -std=c++0x... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with +std=c++0x... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -h std=c++0x... no
checking whether ccache
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/bin/g++
supports C++11 features with -std:c++0x... no
configure: error: *** A compiler with support for C++11 language
features is required.
make[3]: *** [Makefile:34:
/home/koen/firmware/builds/generic_dr40x9/build_dir/host/expat-2.6.0/.configured]
Error 1
make[3]: Leaving directory
'/home/koen/firmware/builds/generic_dr40x9/tools/expat'
time: tools/expat/compile#0.94#0.25#1.17
ERROR: tools/expat failed to build.
make[2]: *** [tools/Makefile:228: tools/expat/compile] Error 1
make[2]: Leaving directory '/home/koen/firmware/builds/generic_dr40x9'
make[1]: *** [tools/Makefile:224:
/home/koen/firmware/builds/generic_dr40x9/staging_dir/host/stamp/.tools_compile_nyyynyynnnnynyyynyyynnynyynnynnyynyyynynnyyy]
Error 2
make[1]: Leaving directory '/home/koen/firmware/builds/generic_dr40x9'
make: *** [/home/koen/firmware/builds/generic_dr40x9/include/toplevel.mk:232:
world] Error 2


koen@roemer:~/firmware/builds/generic_dr40x9$ uname -a
Linux roemer 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC
2023 x86_64 x86_64 x86_64 GNU/Linux


koen@roemer:~/firmware/builds/generic_dr40x9$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Koen

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


[PATCH] mediatek: filogic: move mt7981 on-SoC blocks to "soc" node in DT

2024-02-13 Thread Rafał Miłecki
From: Rafał Miłecki 

It's a standard way of grouping on-SoC hardware blocks and this matches
upstream DTS.

Signed-off-by: Rafał Miłecki 
---
 .../arch/arm64/boot/dts/mediatek/mt7981.dtsi  | 1245 +
 .../arch/arm64/boot/dts/mediatek/mt7981.dtsi  | 1245 +
 2 files changed, 1252 insertions(+), 1238 deletions(-)

diff --git 
a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981.dtsi 
b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981.dtsi
index cb161df81e..35946cbefe 100644
--- a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981.dtsi
+++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981.dtsi
@@ -41,16 +41,632 @@
};
};
 
-   pwm: pwm@10048000 {
-   compatible = "mediatek,mt7981-pwm";
-   reg = <0 0x10048000 0 0x1000>;
-   #pwm-cells = <2>;
-   clocks = < CLK_INFRA_PWM_STA>,
-< CLK_INFRA_PWM_HCK>,
-< CLK_INFRA_PWM1_CK>,
-< CLK_INFRA_PWM2_CK>,
-< CLK_INFRA_PWM3_CK>;
-   clock-names = "top", "main", "pwm1", "pwm2", "pwm3";
+   soc {
+   compatible = "simple-bus";
+   ranges;
+   #address-cells = <2>;
+   #size-cells = <2>;
+
+   pwm: pwm@10048000 {
+   compatible = "mediatek,mt7981-pwm";
+   reg = <0 0x10048000 0 0x1000>;
+   #pwm-cells = <2>;
+   clocks = < CLK_INFRA_PWM_STA>,
+< CLK_INFRA_PWM_HCK>,
+< CLK_INFRA_PWM1_CK>,
+< CLK_INFRA_PWM2_CK>,
+< CLK_INFRA_PWM3_CK>;
+   clock-names = "top", "main", "pwm1", "pwm2", "pwm3";
+   };
+
+   thermal: thermal@1100c800 {
+   #thermal-sensor-cells = <1>;
+   compatible = "mediatek,mt7981-thermal", 
"mediatek,mt7986-thermal";
+   reg = <0 0x1100c800 0 0x800>;
+   interrupts = ;
+   clocks = < CLK_INFRA_THERM_CK>,
+< CLK_INFRA_ADC_26M_CK>;
+   clock-names = "therm", "auxadc";
+   mediatek,auxadc = <>;
+   mediatek,apmixedsys = <>;
+   nvmem-cells = <_calibration>;
+   nvmem-cell-names = "calibration-data";
+   };
+
+   auxadc: adc@1100d000 {
+   compatible = "mediatek,mt7981-auxadc",
+"mediatek,mt7986-auxadc",
+"mediatek,mt7622-auxadc";
+   reg = <0 0x1100d000 0 0x1000>;
+   clocks = < CLK_INFRA_ADC_26M_CK>,
+< CLK_INFRA_ADC_FRC_CK>;
+   clock-names = "main", "32k";
+   #io-channel-cells = <1>;
+   };
+
+   wdma: wdma@15104800 {
+   compatible = "mediatek,wed-wdma";
+   reg = <0 0x15104800 0 0x400>,
+ <0 0x15104c00 0 0x400>;
+   };
+
+   ap2woccif: ap2woccif@151a5000 {
+   compatible = "mediatek,ap2woccif";
+   reg = <0 0x151a5000 0 0x1000>,
+ <0 0x151ad000 0 0x1000>;
+   interrupt-parent = <>;
+   interrupts = ,
+;
+   };
+
+   infracfg: infracfg@10001000 {
+   compatible = "mediatek,mt7981-infracfg", "syscon";
+   reg = <0 0x10001000 0 0x1000>;
+   #clock-cells = <1>;
+   };
+
+   topckgen: topckgen@1001B000 {
+   compatible = "mediatek,mt7981-topckgen", "syscon";
+   reg = <0 0x1001B000 0 0x1000>;
+   #clock-cells = <1>;
+   };
+
+   apmixedsys: apmixedsys@1001E000 {
+   compatible = "mediatek,mt7981-apmixedsys", 
"mediatek,mt7986-apmixedsys", "syscon";
+   reg = <0 0x1001E000 0 0x1000>;
+   #clock-cells = <1>;
+   };
+
+   watchdog: watchdog@1001c000 {
+   compatible = "mediatek,mt7986-wdt",
+"mediatek,mt6589-wdt";
+   reg = <0 0x1001c000 0 0x1000>;
+   interrupts = ;
+   #reset-cells = <1>;
+   status = "disabled";
+   };
+
+   gic: interrupt-controller@c00 {
+   compatible = "arm,gic-v3";
+