From 128a74862685fe3940471ef3c63322ee6f8720b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Tue, 8 Jun 2021 23:30:40 +0200 Subject: [PATCH] Add support for x86_64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds support for the x86_64 target. Both legacy and UEFI boot are supported. Currently, only a single network interface is supported, which is configured like any other ONE_PORT device. Therefore, this target is not very useful for the node variant. However, vlan interfaces can be configured for client, wan and peering sections in the layer3 configuation. Signed-off-by: Fabian Bläse Reviewed-by: Christian Dresel Reviewed-by: Robert Langhammer --- bsp/x86-64.bsp | 4 ++++ bsp/x86-64/.config | 18 ++++++++++++++++++ .../files/etc/uci-defaults/15-fff-boardname | 4 ++++ .../files/lib/functions/fff/cpuport | 1 + .../fff/fff-network/x86_64/network.mode | 1 + .../fff/fff-network/x86_64/network.x86_64 | 7 +++++++ 6 files changed, 35 insertions(+) create mode 100644 bsp/x86-64.bsp create mode 100644 bsp/x86-64/.config create mode 100644 src/packages/fff/fff-network/x86_64/network.mode create mode 100644 src/packages/fff/fff-network/x86_64/network.x86_64 diff --git a/bsp/x86-64.bsp b/bsp/x86-64.bsp new file mode 100644 index 00000000..0ef6db52 --- /dev/null +++ b/bsp/x86-64.bsp @@ -0,0 +1,4 @@ +chipset=x86 +subtarget=64 +images=("openwrt-${chipset}-${subtarget}-generic-squashfs-combined-*" + ) diff --git a/bsp/x86-64/.config b/bsp/x86-64/.config new file mode 100644 index 00000000..79e3255c --- /dev/null +++ b/bsp/x86-64/.config @@ -0,0 +1,18 @@ +# Generated using "./buildscript config openwrt". +# Do no edit manually +# +CONFIG_TARGET_x86=y +CONFIG_TARGET_x86_64=y +CONFIG_TARGET_x86_64_DEVICE_generic=y +# CONFIG_TARGET_ROOTFS_EXT4FS is not set +CONFIG_BUSYBOX_CUSTOM=y +CONFIG_TARGET_PER_DEVICE_ROOTFS=y +# CONFIG_BUSYBOX_CONFIG_BRCTL is not set +# CONFIG_BUSYBOX_CONFIG_CROND is not set +# CONFIG_BUSYBOX_CONFIG_CRONTAB is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_FAST_TOP is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER is not set +CONFIG_CLEAN_IPKG=y +# CONFIG_PACKAGE_ALFRED_VIS is not set +CONFIG_PACKAGE_opkg=m +CONFIG_STRIP_KERNEL_EXPORTS=y diff --git a/src/packages/fff/fff-boardname/files/etc/uci-defaults/15-fff-boardname b/src/packages/fff/fff-boardname/files/etc/uci-defaults/15-fff-boardname index 817e81a2..2d864ec8 100644 --- a/src/packages/fff/fff-boardname/files/etc/uci-defaults/15-fff-boardname +++ b/src/packages/fff/fff-boardname/files/etc/uci-defaults/15-fff-boardname @@ -1,5 +1,9 @@ BOARD=$(cat /var/sysinfo/board_name) +if uname -a | grep x86_64 > /dev/null; then + BOARD="x86_64" +fi + uci set board.model.name=$BOARD uci commit board diff --git a/src/packages/fff/fff-network/files/lib/functions/fff/cpuport b/src/packages/fff/fff-network/files/lib/functions/fff/cpuport index 5f6e7c95..31cfb600 100644 --- a/src/packages/fff/fff-network/files/lib/functions/fff/cpuport +++ b/src/packages/fff/fff-network/files/lib/functions/fff/cpuport @@ -24,6 +24,7 @@ get_cpu_port() { ubnt,nanostation-loco-m-xw|\ ubnt,unifi|\ ubnt,unifiac-mesh|\ + x86_64|\ xiaomi,mi-router-4a-gigabit) CPUPORT="" ;; diff --git a/src/packages/fff/fff-network/x86_64/network.mode b/src/packages/fff/fff-network/x86_64/network.mode new file mode 100644 index 00000000..3b768735 --- /dev/null +++ b/src/packages/fff/fff-network/x86_64/network.mode @@ -0,0 +1 @@ +ETHMODE="CLIENT" \ No newline at end of file diff --git a/src/packages/fff/fff-network/x86_64/network.x86_64 b/src/packages/fff/fff-network/x86_64/network.x86_64 new file mode 100644 index 00000000..07e68b99 --- /dev/null +++ b/src/packages/fff/fff-network/x86_64/network.x86_64 @@ -0,0 +1,7 @@ +WANDEV=eth0 +SWITCHDEV=eth0 +ONE_PORT="YES" + +. /etc/network.mode + +ROUTERMAC=$(cat /sys/class/net/eth0/address) \ No newline at end of file