1566 Commits

Author SHA1 Message Date
hanwckf
b0c2ac27a3 mediatek: add mtk-smp package to exec smp.sh
mtk-smp: add usb smp settings
2024-01-13 13:53:22 +08:00
hanwckf
ebf353ff63 Merge branch 'openwrt-21.02' of https://github.com/immortalwrt/immortalwrt into openwrt-21.02 2023-12-05 23:14:26 +08:00
Jan-Niklas Burfeind
90c8c47188
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-10-22 12:44:55 +08:00
hanwckf
7e234b0bd8 base-files: fix PKG_CONFIG_DEPENDS for wifi-profile 2023-10-20 01:04:26 +08:00
hanwckf
dd4312da3b Merge branch 'openwrt-21.02' of https://github.com/immortalwrt/immortalwrt into openwrt-21.02 2023-09-29 01:04:42 +08:00
Brian Norris
683751adda
base-files: Remove nand.sh dependency from emmc upgrade
emmc_do_upgrade() relies on identify() from the nand.sh upgrade helper.
This only works because FEATURES=emmc targets also tend to include
FEATURES=nand.

Rename identify_magic() to identify_magic_long() to match the common.sh
style and make it clear it pairs with other *_long() variants (and not,
say *_word()).

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(cherry picked from commit d3c19c71f6044eff1677563365cea0f9e919b462)
2023-09-26 15:41:19 +08:00
Brian Norris
cd655a8b30
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>
(cherry picked from commit e8a0c55909427703b7c72ed46326531397287b20)
2023-09-26 15:38:06 +08:00
Enrico Mioso
7c89acbebf
base-files: add eMMC sysupgrade support
Adds generic support for sysupgrading on eMMC-based devices.

Provide function emmc_do_upgrade and emmc_copy_config to be used in
/lib/upgrade/platform.sh instead of redundantly implementing the same
logic over and over again.
Similar to generic sysupgrade on NAND, use environment variables
CI_KERNPART, CI_ROOTPART and newly introduce CI_DATAPART to indicate
GPT partition names to be used. On devices with more than one MMC
block device, CI_ROOTDEV can be used to specify the MMC device for
partition name lookups.

Also allow to select block devices directly using EMMC_KERN_DEV,
EMMC_ROOT_DEV and EMMC_DATA_DEV, as using GPT partition names is not
always an option (e.g. when forced to use MBR).

To easily handle writing kernel and rootfs make use of sysupgrade.tar
format convention which is also already used for generic NAND support.

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
CC: Li Zhang <li.zhang@gl-inet.com>
CC: TruongSinh Tran-Nguyen <i@truongsinh.pro>
(cherry picked from commit 57c1f3f9c5c699cc215bebde772552787c632570)
2023-09-26 15:36:54 +08:00
Daniel Golle
faec1771f6
base-files: allow specifiying rootdev for find_mmc_part
Some devices got more than one mmc device.
Allow specifying the root device as 2nd parameter of find_mmc_part so
scripts can avoid matching irrelevant partitions on wrong mmc device.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 9f223a20bd5f0cbec9f34427588b645ae38433ff)
2023-09-26 15:35:02 +08:00
Davide Fioravanti
9bc1deec7f
base-files: add minimal mmc support
Added minimal mmc support for helper functions:

 - find_mmc_part: Look for a given partition name. Returns the
	coresponding partition path
 - caldata_extract_mmc: Look for a given partition name and then
	extracts the calibration data
 - mmc_get_mac_binary: Returns the mac address from a given partition
	name and offset

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>
(cherry picked from commit 6e137943442fb0ab66c34462fa19e5a4260eddd5)
2023-09-26 15:31:39 +08:00
Tianling Shen
c989b26be4
ImmortalWrt v21.02.7: revert to branch defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-09-07 13:35:29 +08:00
Tianling Shen
b6dd058ff1
ImmortalWrt v21.02.7: adjust config defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-09-07 13:35:23 +08:00
hanwckf
5ea9ded3d1 Merge branch 'openwrt-21.02' of https://github.com/immortalwrt/immortalwrt into openwrt-21.02 2023-06-28 00:47:14 +08:00
Tianling Shen
6114723dd1
ImmortalWrt v21.02.6: revert to branch defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-05-01 14:42:56 +08:00
Tianling Shen
6fce758996
ImmortalWrt v21.02.6: adjust config defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-05-01 14:42:53 +08:00
Tianling Shen
9773b2a49e
Revert "base-files: do not generate ULA prefix"
This reverts commit ee76f4feb20a5e66b47524b185fc10ca4a01bced.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-04-02 15:56:15 +08:00
hanwckf
3520be6447 Merge branch 'openwrt-21.02' of https://github.com/immortalwrt/immortalwrt into openwrt-21.02 2023-03-28 01:37:18 +08:00
Tianling Shen
d1e165884e
ImmortalWrt v21.02.5: revert to branch defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-03-25 14:40:33 +08:00
Tianling Shen
7853a2498f
ImmortalWrt v21.02.5: adjust config defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-03-25 14:40:33 +08:00
Tianling Shen
1da9099f0f
ImmortalWrt v21.02.4: revert to branch defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-02-14 05:59:11 +08:00
Tianling Shen
b00741e92a
ImmortalWrt v21.02.4: adjust config defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-02-14 05:59:07 +08:00
LGA1150
ee76f4feb2
base-files: do not generate ULA prefix
(cherry picked from commit 9f853eb850dfa4034c3fb333fffc63721bbd81d2)
2023-01-28 22:19:04 +08:00
hanwckf
606a7d6270 Merge branch 'openwrt-21.02' of https://github.com/immortalwrt/immortalwrt into openwrt-21.02 2022-12-15 19:51:45 +08:00
Tianling Shen
36de5d6ab5
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-12-06 03:04:32 +08:00
Rafał Miłecki
8a11563b06 base-files: support "metric" in board.json
It allows prepopulating /etc/config/network interface-s with predefined
metric. It may be useful for devices with multiple WAN ports.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 7f443d2d9aa1170d6b68f0dc6d5b5552882ee327)
2022-12-01 16:09:27 +01:00
hanwckf
efe25d8d06 base-files: set log_size to 512 2022-11-16 22:08:50 +08:00
hanwckf
f54003f7c6 package: mtk: add applications and drivers 2022-11-16 22:08:49 +08:00
hanwckf
c8387c0947 base-files: exec smp.sh 2022-11-16 22:08:49 +08:00
Florian Eckert
c128728811
procd: move service command to procd
The service command belongs to the procd and does not belong in the
shinit. In the course of the move, the script was also checked with
shellcheck and cleaned up.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit b9017384cae7bbc47186fdf35a80207844876a0d)
2022-11-13 14:24:29 +08:00
Tianling Shen
b66c7956e0
ImmortalWrt v21.02.2: revert to branch defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-10-18 13:54:17 +08:00
Tianling Shen
53f29923e0
ImmortalWrt v21.02.2: adjust config defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-10-18 13:53:43 +08:00
Hauke Mehrtens
32f8c6fdf8 OpenWrt v21.02.5: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-10-15 15:02:49 +02:00
Hauke Mehrtens
ea34ce11c1 OpenWrt v21.02.5: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-10-15 15:02:44 +02:00
Hauke Mehrtens
e0bb4b7a78 OpenWrt v21.02.4: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-10-09 19:13:55 +02:00
Hauke Mehrtens
66ee6c2231 OpenWrt v21.02.4: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-10-09 19:13:29 +02:00
Olliver Schinagl
b22acea8c5
base-files: Actually set default name
The currently used shell expansion doesn't seem to exist [0] and also
does not work. This surely was not intended, so lets allow default
naming to actually work.

[0]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html

Fixes: be09c5a3cd65 ("base-files: add board.d support for bridge device")
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
(cherry picked from commit 211f4302e4f64e84e2895c6ed55fc1f43da56528)
2022-09-27 17:10:07 +08:00
Tianling Shen
cec31d8c48
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-09-27 17:07:22 +08:00
Alexey Smirnov
1ea34b9621 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>
(cherry picked from commit 66071729a27919e555752fce25210b1b035eb319)
2022-09-24 18:00:12 +02:00
Florian Eckert
94b95569e4
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>
(cherry picked from commit 09c41ea6792a86cfcacb13f6727f5049c3f87cd6)
2022-09-01 15:00:46 +08:00
Tianling Shen
a9c5419ef5
ImmortalWrt v21.02.1: revert to branch defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-07-09 10:47:08 +08:00
Tianling Shen
fb5569750a
ImmortalWrt v21.02.1: adjust config defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-07-09 10:47:07 +08:00
Tianling Shen
93ab8506e1
ImmortalWrt v21.02.0: revert to branch defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-04-22 07:11:48 +08:00
Tianling Shen
57dfa297a2
ImmortalWrt v21.02.0: adjust config defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-04-22 07:11:47 +08:00
Hauke Mehrtens
f0f9b7ac5c OpenWrt v21.02.3: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-04-17 21:00:07 +02:00
Hauke Mehrtens
42a15ca378 OpenWrt v21.02.3: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-04-17 21:00:03 +02:00
Tianling Shen
8561c26155
base-files: tweak banner
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit be0ac56b63e45a57ae6b92d2c89507ce8312b04a)
2022-03-15 20:36:25 +08:00
Tianling Shen
c6c26010c2
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-03-15 18:50:25 +08:00
Tianling Shen
2c16ee6a6d
include/version: use ImmortalWrt's release repo
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-03-14 21:45:05 +08:00
Rafał Miłecki
f44f8b07b0 base-files: call "sync" after initial setup
OpenWrt uses a lot of (b)ash scripts for initial setup. This isn't the
best solution as they almost never consider syncing files / data. Still
this is what we have and we need to try living with it.

Without proper syncing OpenWrt can easily get into an inconsistent state
on power cut. It's because:
1. Actual (flash) inode and data writes are not synchronized
2. Data writeback can take up to 30 seconds (dirty_expire_centisecs)
3. ubifs adds extra 5 seconds (dirty_writeback_centisecs) "delay"

Some possible cases (examples) for new files:
1. Power cut during 5 seconds after write() can result in all data loss
2. Power cut happening between 5 and 35 seconds after write() can result
   in empty file (inode flushed after 5 seconds, data flush queued)

Above affects e.g. uci-defaults. After executing some migration script
it may get deleted (whited out) without generated data getting actually
written. Power cut will result in missing data and deleted file.

There are three ways of dealing with that:
1. Rewriting all user-space init to proper C with syncs
2. Trying bash hacks (like creating tmp files & moving them)
3. Adding sync and hoping for no power cut during critical section

This change introduces the last solution that is the simplest. It
reduces time during which things may go wrong from ~35 seconds to
probably less than a second. Of course it applies only to IO operations
performed before /etc/init.d/boot . It's probably the stage when the
most new files get created.

All later changes are usually done using smarter C apps (e.g. busybox or
uci) that creates tmp files and uses rename() that is expected to be
atomic.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
(cherry picked from commit 9851d4b6ce6e89d164a04803817625a9041b060a)
2022-03-14 08:51:02 +01:00
Tianling Shen
0910bd64ff
base-files: update default banner
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 29c5695d928459ac37e8f5c1936861f3c2bfabf3)
2022-03-13 16:56:25 +08:00