Commit Graph

109 Commits

Author SHA1 Message Date
coolsnowwolf
e905fdb169 OpenWrt v24.10.0: adjust config defaults 2025-02-06 19:35:15 +08:00
coolsnowwolf
e1204bd00d Version update to 24.10.0-rc5 2025-01-06 20:30:00 +08:00
coolsnowwolf
0a3cb8e16a ramips: add setmac and getmac scripts 2024-12-16 11:21:10 +08:00
coolsnowwolf
d242992f65 base-files: allow override model name from uboot env 2024-12-11 19:28:11 +08:00
coolsnowwolf
fbc2865461 Release: v24.10.0-rc1: adjust config defaults 2024-12-02 19:28:12 +08:00
coolsnowwolf
d17b0026c2 LEDE v24.10: set branch defaults 2024-11-17 23:02:41 +08:00
coolsnowwolf
9b5d129bec Version update to R24.11.11 2024-11-14 14:14:42 +08:00
coolsnowwolf
1063641e6e branding: add LEDE branding 2024-11-14 13:14:47 +08:00
coolsnowwolf
b7cf62b3a8 base-files: improve Luci2 js support 2024-10-17 19:05:31 +08:00
Hauke Mehrtens
8f378b3297 base-files: failsafe: Remove the VLAN modifier from interface name
Some interfaces have a VLAN modifier like :t in lan1:t, this modifier
should be removed from the interface before calling preinit_ip_config().

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-17 17:22:09 +08:00
Arınç ÜNAL
05979aadf6 base-files: add protocol ncm support for ucidef_set_interface()
Make it possible to set up a default network (interface) for devices with
cellular modems using NCM.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
2024-10-17 17:19:39 +08:00
coolsnowwolf
2757124d34 procd: move service command to procd 2024-10-17 17:12:14 +08:00
coolsnowwolf
9f40de14ca base-files: simplify restorecon logic 2024-10-17 17:04:21 +08:00
coolsnowwolf
8527c75281 base-files: ipcalc.sh: check for params before calculating start/end 2024-10-17 16:51:29 +08:00
coolsnowwolf
864e344469 base-files: stage2: add 'tail' to sysupgrade environment 2024-10-17 16:46:31 +08:00
coolsnowwolf
1175c829e6 base-files: rework mtd_get_mac_text() 2024-10-17 16:34:38 +08:00
Luiz Angelo Daros de Luca
1627fd2c74 base-files: bring up vlan interface too
Vlan subinterface was never brought up when using vlan-based preinit network.
Tested forcing ifname="" before preinit_ip() on a Tp-Link Archer C5v4.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2024-10-17 16:09:49 +08:00
Mark Baker
508dd96b84 base-files: add support for retrieving IPv6 assignments
In DHCPv6-PD enabled environments, addresses are assigned to interfaces.
These new functions retrieve the IPv6 assigned prefix(es).

Signed-off-by: Mark Baker <mark@vpost.net>
2024-10-17 16:06:09 +08:00
Karel Kočí
1c2a7462df base-files: fix enabled for services with only STOP
There are services that have only STOP value set. They are executed only
on shutdown and it is common to use them for system cleanup. There is
one such service shipped directly with base-files, it is 'umount'. Those
work the same way as those with START but enabled does not report them
as enabled although it should have as they can be enabled and disabled
as any other service.

This also changes check from check for executable to check for symbolic
link. The implementation depends on those being links to service file
and it is much cleaner and direct to check for them being links.

Signed-off-by: Karel Kočí <karel.koci@nic.cz>
2024-10-17 16:03:37 +08:00
Florian Eckert
bd8d34909d base-files: fix service_running check
The following command checks if a instance of a service is running.
/etc/init.d/<service> running <instance>

 In the variable `$@`, which is passed to the function
`service_running`, the first argument is always the `instance` which
should be checked. Because all other variables where removed from `$@`
with `shift`.

Before this change the first argument of `$@` was set to the `$service`
Variable. So the function does not work as expected. The `$service`
variable was always the instance which should be checked. This is not
what we want.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
2024-10-17 16:02:48 +08:00
Florian Eckert
b498e0ac33 base-files: add wrapper for procd service list command
A service managed by procd does have a json object with usefull information.
This information could by dumped with the following command.

ubus call service list "{ 'verbose':true, 'name': '<service-name>)'". }"

This line is long and complicated to enter. This commit adds a wrapper
call to the procd service section tool to simplify the input and get the
output faster.

We could now enter the command /etc/initd/<service> info to get the info
faster.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-10-17 16:01:07 +08:00
Alexey Smirnov
98b97c58f2 base-files: add support for heartbeat led trigger
This patch adds support for creation heartbeat led trigger with,
for example, this command:

	ucidef_set_led_heartbeat "..." "..." "..."

from /etc/board.d/01_leds.

Signed-off-by: Alexey Smirnov <s.alexey@gmail.com>
2024-10-17 15:42:50 +08:00
Olliver Schinagl
8f7e660d4d base-files: LED/trigger/heartbeat: Add support for inversion
The heartbeat trigger has the option to be inverted, however
openwrt/uci/luci have no way to set this.

This patch adds this support.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-10-17 15:39:53 +08:00
Olliver Schinagl
cf0d45e534 base-files: LED/gpio: Ensure inverted is read as a boolean
The sysfs interface for the GPIO takes a boolean value. Ensure we get
one from uci.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-10-17 15:39:13 +08:00
Mark Mentovai
a4c100df52 failsafe: run on all consoles listed in /proc/cmdline
On x86, when both CONFIG_GRUB_CONSOLE and CONFIG_GRUB_SERIAL are set (as
they are by default), the kernel command line will have two console=
entries, such as

    console=tty0 console=ttyS0,115200n8

Failsafe was only running a shell on the first defined console, the VGA
console. This is a problem for devices like apu2, where there is only a
serial console and it appears on ttyS0.

Moreover, the console prompt to enter failsafe during boot was delivered
to, and its input read from, the last console= on the kernel command
line. So while the failsafe shell was on the first defined console, only
the last defined console could be used to enter failsafe during boot.

In contrast, the x86 bootloader (GRUB) operates on both the serial
console and the VGA console by virtue of "terminal_{input,output}
console serial". GRUB also provided an alternate means to enter failsafe
from either console. The presence of two console= kernel command line
parameters causes kernel messages to be delivered to both. Under normal
operation (not failsafe), procd runs login in accordance with inittab,
which on x86 specifies ttyS0, hvc0, and tty1, allowing login through any
of serial, hypervisor, or VGA console. Thus, serial access was
consistently available on x86 devices with serial consoles under normal
operation, except for shell access in failsafe mode (without editing the
kernel command line).

By presenting the failsafe prompt, reading failsafe prompt input, and
running failsafe shells on all consoles listed in /proc/cmdline,
failsafe mode will work correctly on devices with a serial console (like
apu2), and the same image without any need for reconfiguration can be
shared by devices with the more traditional (for x86) VGA console. This
improvement should benefit any system with multiple console= arguments,
including x86 and bcm27xx (Raspberry Pi).

Signed-off-by: Mark Mentovai <mark at moxienet.com>
2024-10-17 15:07:03 +08:00
Matthias Schiffer
75663fdd70 base-files: fix merge of passwd/shadow/group lines with trailing colons
Empty trailing fields get lost when the lines are split and merged again
at colons, resulting in unparsable entries. Only use the split fields for
matching against the other file, but emit the original line unchanged
to fix the issue.

Fixes: de7ca7dafadf ("base-files: merge /etc/passwd et al at sysupgrade config restore")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2024-10-17 15:03:52 +08:00
Shiji Yang
a4b597b221 base-files: support parse DT LED color and function
The 'label' property in led node has been deprecated and we'd better
to avoid using it. This patch allows us to extract DT OF LED name
from the newly introduced LED properties "color", "function" and
"function-enumerator".

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2024-10-17 15:00:48 +08:00
Philip Prindeville
1172e4c4b6 busybox: preserve crontabs
/etc/syslog.conf is used by sysklogd, and /etc/crontabs is used
by crond, both features of busybox.  Given this, ownership for
these files should be bound to busybox, especially if one day
there's a way to do an in-place opkg update of busybox.

There's also the busybox provided syslogd which uses this file
if CONFIG_BUSYBOX_FEATURE_SYSLOGD_CFG is set.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2024-10-17 14:54:38 +08:00
Tony Ambardar
da4a165063 base-files: enable BPF JIT kallsyms by default
Set net.core.bpf_jit_kallsyms=1 in /etc/sysctl.d/10-default.conf.

For privileged users, this exports addresses of JIT-compiled programs to
appear in /proc/kallsyms when present, allowing their use for debugging
and in traces.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2024-10-17 14:53:07 +08:00
David Bauer
1af9ce7777 base-files: allow ignoring minor compat-version check
Downstream projects might re-generate device-specific configuration
based on OpenWrt's defaults on each upgrade, thus being unaffected by
forward- as well as backwards-breaking configuration.

Add a new sysupgrade parameter, which allows sysupgrades between minor
compat-versions. Upgrades will still fail upon mismatching major compat
versions.

Signed-off-by: David Bauer <mail@david-bauer.net>
2024-10-17 14:47:58 +08:00
Andre Heider
f6243f2bb4 base-files: add 'isup' to the wifi script
This is a silent command that allows easy wifi up/down automation for
scripts.

It takes one or multiple devices as arguments (or all if none are passed),
and the exit code indicates if any of those is not up.

E.g.:
wifi isup && echo "all wifi devices are up"
wifi isup radio0 || echo "this wifi is down"

Signed-off-by: Andre Heider <a.heider@gmail.com>
2024-10-17 14:46:48 +08:00
aiamadeus
ddaa6722f4 base-files: move ntp server to default settings 2024-07-06 23:05:37 +08:00
coolsnowwolf
b9b078da8e base-files: upgrade: nand.sh: mute umount error 2024-07-02 13:16:51 +08:00
coolsnowwolf
319b46b4bd base-files: recognize bootdevice on devices using fitblk 2024-07-02 13:14:41 +08:00
coolsnowwolf
dfa2935600 base-files: add TARGET_DEFAULT_LAN_IP_FROM_PREINIT for setting the default LAN IP address and netmask 2024-06-21 18:37:12 +08:00
coolsnowwolf
57c907ddb6 base-files: add legacy-sdcard sysupgrade support 2024-05-26 23:16:05 +08:00
Rodrigo Balerdi
d3ab2cd000 base-files: minor fix to mmc_mac_ascii function
This is mostly a cosmetic cleanup. The absence of
the return statement was not causing any problems.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2024-04-09 21:50:04 +08:00
Daniel Golle
46583553b7 base-files: add mmc_get_mac_ascii function
Similar to the *_get_mac_binary function, also split the common parts
off mtd_get_mac_ascii into new get_mac_ascii function and introduce
mmc_get_mac_ascii which uses it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-12-20 23:10:30 +08:00
Brian Norris
104c0575ef base-files: Align rootfs_data upgrades to 64KiB on eMMC
Rootfs overlays get created at a ROOTDEV_OVERLAY_ALIGN (64KiB)
alignment after the rootfs, but emmc_do_upgrade() is assuming
it comes at the very next 512-byte sector.

Suggested-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(move spaces around, mention fstools' libtoolfs)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2023-11-04 15:21:58 +08:00
coolsnowwolf
8c39e48514 base-files: create empty coremark file
Fixes: #11590
2023-10-16 21:50:53 +08:00
woOzZ2
daacfa7071
base-files: fix OpenWrt with Docker will cause NAT loopback (#11588)
Fixed the problem that even if br-netfilter is disabled in package/kernel/linux/files/sysctl-br-netfilter.conf, NAT loopback will still fail. This applies to OpenWrt with Docker
2023-10-15 23:05:01 -05:00
Davide Fioravanti
f6c316d52e base-files: add minimal mmc support
Added minimal mmc support for helper functions.

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
[replace dd with caldata_dd, moved sysupgrade mmc to orbi]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2023-07-14 21:59:15 +08:00
Florian Eckert
21364cecb2 base-files: change logging for upgrade on stage2
Remove vn call in favour of v call. This commit serves as preparation
for removing the vn function call.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-06-24 22:58:17 +08:00
Jan-Niklas Burfeind
d9c821597d sunxi: ensure NanoPi R1 has unique MAC address
Ensure the MAC address for all NanoPi R1 boards is assigned uniquely for
each board.

The vendor ships the device in two variants; one with and one without
eMMC; but both without static mac-addresses.
In order to assign both board types unique MAC addresses, fall back on
the same method used for the NanoPi R2S and R4S in case the EEPROM
chip is not present by generating the board MAC from the SD card CID.

[0] https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R1#Hardware_Spec

Similar too and based on:

commit b5675f500daf ("rockchip: ensure NanoPi R4S has unique MAC address")

Co-authored-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
2023-05-11 23:10:55 +08:00
coolsnowwolf
0747f72a7f base-files: force remount ext4 rootfs when power-off by accident last time 2023-03-29 18:32:18 +08:00
younger
dd7c89aa77
base-files: fixes x86 sysupgrade (#10992)
Fixes: #10986
2023-03-13 00:10:47 +08:00
Yuan Tao
ccb04d670d base-files: sysfixtime: Fix time on the fake RTC
On some devices the chip has RTC but no battery save time.
This leads back to getting the wrong time
and skipping the check of the last file modification date.

This commit ensures that the file time is checked even
if the RTC exists.
which would ordinarily return an approbiate
system time used for e.g. certificate generation.

Tested-on: NanoPi R2S

Signed-off-by: Yuan Tao <ty@wevs.org>
2023-02-22 23:35:16 +08:00
Andrey Butirsky
9592f13790 base-files: add protocol qmi/mbim support for ucidef_set_interface()
Make it possible to setup default WAN interface for devices with built-in LTE
modems, using QMI or MBIM.

Signed-off-by: Andrey Butirsky <butirsky@gmail.com>
Reviewed-by: Lech Perczak <lech.perczak@gmail.com>
2023-01-11 19:40:05 +08:00
Felix Fietkau
2f8864218f base-files: add helper functions for adding wlan device entries to board.json
These will be used to give WLAN PHYs a specific name based on path specified
in board.json. The platform board.d script can assign a specific order based
on available slots (PCIe slots, WMAC device) and device tree configuration.

This helps with maintaining config compatibility in case the device path
changes due to kernel upgrades.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-01-11 19:38:11 +08:00
Bob Cantor
5052e70674 base-files: wifi: for wifi reconf, scan_wifi after network reload
Commit e8b542960921 included an unintended change and we now call
scan_wifi before a network reload.

Restore the original behaviour and call scan_wifi only after a network
reload.

Fixes: e8b542960921 ("base-files: wifi: tidy up the reconf code")
Signed-off-by: Bob Cantor <bobc@confidesk.com>
2022-12-08 17:41:33 +08:00