Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled

This commit is contained in:
domenico
2025-06-24 14:35:53 +02:00
commit c06fb25d1f
9263 changed files with 1750214 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
# Copyright (C) 2018 OpenWrt.org
. /lib/functions.sh
. /lib/functions/system.sh
set_recovery_mac_address() {
local RECOVERY_PART="$1"
local mac
if [ -b $RECOVERY_PART ]; then
insmod nls_cp437
insmod nls_iso8859-1
insmod fat
insmod vfat
mkdir -p /tmp/recovery
if mount -o rw,noatime $RECOVERY_PART -t vfat /tmp/recovery; then
if [ -f "/tmp/recovery/mac_addr" ];
then
mac=$(cat /tmp/recovery/mac_addr)
else
mac=$(cat /sys/class/net/eth0/address)
echo "$mac" > /tmp/recovery/mac_addr
fi
sync
umount /tmp/recovery
rmdir /tmp/recovery
ip link set dev wan address $mac 2> /dev/null
mac=$(macaddr_add $mac 1)
ip link set dev lan0 address $mac 2>/dev/null
ip link set dev lan1 address $mac 2>/dev/null
ip link set dev lan2 address $mac 2>/dev/null
ip link set dev lan3 address $mac 2>/dev/null
fi
fi
}
preinit_set_mac_address() {
local rootpart
case $(board_name) in
unielec,u7623-02-emmc-512m)
set_recovery_mac_address /dev/mmcblk0p1
;;
esac
}
boot_hook_add preinit_main preinit_set_mac_address

View File

@@ -0,0 +1,33 @@
# Copyright (C) 2015 OpenWrt.org
. /lib/upgrade/common.sh
move_config() {
local partdev partnum
case $(board_name) in
unielec,u7623-02-emmc-512m)
if grep -q root=/dev/mmcblk0p2 /proc/cmdline; then
partnum=1;
else
partnum=2;
fi
;;
*)
return 1
;;
esac
if export_bootdevice && export_partdevice partdev $partnum; then
insmod nls_cp437
insmod nls_iso8859-1
insmod fat
insmod vfat
mkdir -p /recovery
mount -o rw,noatime "/dev/$partdev" -t vfat /recovery
[ -f "/recovery/$BACKUP_FILE" ] && mv -f "/recovery/$BACKUP_FILE" /
umount /recovery
fi
}
boot_hook_add preinit_mount_root move_config