0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2025-04-23 00:25:49 +00:00
Files
Fabian Groffen 26d43b039d octeon/generic: ubnt,erlite: define profile
Currently the erlite install shows Model as EBNT_E100, uses eth0 as lan,
eth1 as wan, and doesn't use eth2.

- define dts for this device, such that we get a cleaner naming here
- fix handing of this device to inlude eth2
- change eth0 to wan, like er-4/usg/etc as it once was intended

Fixes: https://github.com/openwrt/openwrt/issues/14946
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Link: https://github.com/openwrt/openwrt/pull/17758
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-02-16 16:06:10 +01:00

51 lines
1.1 KiB
Plaintext

# Copyright (C) 2014 OpenWrt.org
move_config() {
. /lib/upgrade/common.sh
local device="$1"
local fstype="$2"
[ -n "$device" ] && [ -b "$device" ] && {
mount -t "${fstype}" "$device" /mnt
[ -f "/mnt/$BACKUP_FILE" ] && mv -f "/mnt/$BACKUP_FILE" /
umount /mnt
}
}
octeon_get_n821_disk() {
local partnum=$1
local MAJOR MINOR DEVNAME DEVTYPE
while read line; do
export -n "${line}"
done < $(find /sys/bus/platform/devices/16f0000000000.ehci/ -path \*block/sd[a-z]/uevent)
echo "/dev/${DEVNAME}${partnum}"
}
octeon_move_config() {
. /lib/functions.sh
case "$(board_name)" in
ubnt,erlite|\
ubnt,usg)
move_config "/dev/sda1" "vfat"
;;
itus,shield-router)
move_config "/dev/mmcblk1p1" "vfat"
;;
er|\
ubnt,edgerouter-4|\
ubnt,edgerouter-6p)
move_config "/dev/mmcblk0p1" "vfat"
;;
cisco,vedge1000)
# Copy from the internal USB disk's first partition.
# It is resolved from the device path to not be dependent on which
# /dev/sd? path it is at, nor which UUID it happens to have.
move_config "$(octeon_get_n821_disk 1)" "ext2"
;;
esac
}
boot_hook_add preinit_mount_root octeon_move_config