Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2024-11-27 21:59:45 +08:00
commit 6f07609c65
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
9 changed files with 46 additions and 13 deletions

View File

@ -103,6 +103,11 @@ else
endif
endif
# include ujail on systems with enough storage
ifeq ($(filter small_flash,$(FEATURES)),)
DEFAULT_PACKAGES+=procd-ujail
endif
# Add device specific packages (here below to allow device type set from subtarget)
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))

View File

@ -43,7 +43,7 @@ define Package/base-files
+netifd +libc +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:openwrt-keyring \
+NAND_SUPPORT:ubi-utils +fstools +fwtool \
+SELINUX:procd-selinux +!SELINUX:procd +USE_SECCOMP:procd-seccomp \
+SELINUX:busybox-selinux +!SELINUX:busybox +!SMALL_FLASH:procd-ujail
+SELINUX:busybox-selinux +!SELINUX:busybox
TITLE:=Base filesystem for OpenWrt
URL:=http://openwrt.org/
VERSION:=$(PKG_RELEASE)~$(lastword $(subst -, ,$(REVISION)))

View File

@ -33,7 +33,8 @@ Build/Compile=
ifneq ($(CONFIG_USE_APK),)
define Package/openwrt-keyring/install
$(INSTALL_DIR) $(1)/etc/apk/keys/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/apk/*.pem $(1)/etc/apk/keys/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/apk/openwrt-snapshots.pem $(1)/etc/apk/keys/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/apk/immortalwrt-snapshots.pem $(1)/etc/apk/keys/
endef
else
define Package/openwrt-keyring/install

View File

@ -47,7 +47,13 @@ for device_id, profile in output.get("profiles", {}).items():
if output:
default_packages, output["arch_packages"] = run(
(
default_packages,
output["arch_packages"],
linux_version,
linux_release,
linux_vermagic,
) = run(
[
"make",
"--no-print-directory",
@ -55,6 +61,9 @@ if output:
"target/linux/",
"val.DEFAULT_PACKAGES",
"val.ARCH_PACKAGES",
"val.LINUX_VERSION",
"val.LINUX_RELEASE",
"val.LINUX_VERMAGIC",
"V=s",
],
stdout=PIPE,
@ -64,7 +73,11 @@ if output:
).stdout.splitlines()
output["default_packages"] = sorted(default_packages.split())
output["linux_kernel"] = {
"version": linux_version,
"release": linux_release,
"vermagic": linux_vermagic,
}
output_path.write_text(json.dumps(output, sort_keys=True, separators=(",", ":")))
else:
print("JSON info file script could not find any JSON files for target")

View File

@ -187,7 +187,7 @@ define Device/acer_vero-w6m
DEVICE_DTS := mt7986a-acer-vero-w6m
DEVICE_DTS_DIR := ../dts
DEVICE_DTS_LOADADDR := 0x47000000
DEVICE_PACKAGES := kmod-leds-ktd202x kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs
IMAGES := sysupgrade.bin
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS := kernel-bin | lzma | \

View File

@ -69,11 +69,12 @@
ports {
port@5 {
reg = <5>;
label = "eth5";
openwrt,netdev-name = "eth5";
phy-handle = <&ephy7>;
phy-mode = "rgmii-rxid";
nvmem-cells = <&macaddr_factory_22 5>;
nvmem-cell-names = "mac-address";
/delete-property/ label;
};
};
};

View File

@ -7,7 +7,7 @@
&gmac1 {
status = "okay";
label = "eth0";
openwrt,netdev-name = "eth0";
phy-handle = <&ethphy0>;
nvmem-cells = <&macaddr_factory_22 0>;

View File

@ -22,42 +22,47 @@
&gmac0 {
nvmem-cells = <&macaddr_factory_22 0>;
nvmem-cell-names = "mac-address";
label = "dsa";
openwrt,netdev-name = "dsa";
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "eth0";
openwrt,netdev-name = "eth0";
/delete-property/ label;
};
port@1 {
status = "okay";
label = "eth1";
openwrt,netdev-name = "eth1";
nvmem-cells = <&macaddr_factory_22 1>;
nvmem-cell-names = "mac-address";
/delete-property/ label;
};
port@2 {
status = "okay";
label = "eth2";
openwrt,netdev-name = "eth2";
nvmem-cells = <&macaddr_factory_22 2>;
nvmem-cell-names = "mac-address";
/delete-property/ label;
};
port@3 {
status = "okay";
label = "eth3";
openwrt,netdev-name = "eth3";
nvmem-cells = <&macaddr_factory_22 3>;
nvmem-cell-names = "mac-address";
/delete-property/ label;
};
port@4 {
status = "okay";
label = "eth4";
openwrt,netdev-name = "eth4";
nvmem-cells = <&macaddr_factory_22 4>;
nvmem-cell-names = "mac-address";
/delete-property/ label;
};
};
};

View File

@ -10,6 +10,14 @@ set_netdev_labels() {
[ "$netdev" = "$label" ] && continue
ip link set "$netdev" name "$label"
done
for dir in /sys/class/net/*; do
[ -r "$dir/of_node/openwrt,netdev-name" ] || continue
read -r label < "$dir/of_node/openwrt,netdev-name"
netdev="${dir##*/}"
[ "$netdev" = "$label" ] && continue
ip link set "$netdev" name "$label"
done
}
boot_hook_add preinit_main set_netdev_labels