diff --git package/base-files/files/bin/config_generate package/base-files/files/bin/config_generate
deleted file mode 100755
index be21d0079a..0000000000
--- package/base-files/files/bin/config_generate
+++ /dev/null
@@ -1,542 +0,0 @@
-#!/bin/sh
-
-CFG=/etc/board.json
-
-. /usr/share/libubox/jshn.sh
-
-[ -s $CFG ] || /bin/board_detect || exit 1
-[ -s /etc/config/network -a -s /etc/config/system ] && exit 0
-
-generate_bridge() {
-	local name=$1
-	local macaddr=$2
-	uci -q batch <<-EOF
-		set network.$name=device
-		set network.$name.name=$name
-		set network.$name.type=bridge
-	EOF
-	if [ -n "$macaddr" ]; then
-		uci -q batch <<-EOF
-			set network.$name.macaddr=$macaddr
-		EOF
-	fi
-}
-
-bridge_vlan_id=0
-generate_bridge_vlan() {
-	local name=$1_vlan
-	local device=$2
-	local ports="$3"
-	local vlan="$4"
-	uci -q batch <<-EOF
-		set network.$name=bridge-vlan
-		set network.$name.device='$device'
-		set network.$name.vlan='$vlan'
-		set network.$name.ports='$ports'
-	EOF
-}
-
-generate_static_network() {
-	uci -q batch <<-EOF
-		delete network.loopback
-		set network.loopback='interface'
-		set network.loopback.device='lo'
-		set network.loopback.proto='static'
-		set network.loopback.ipaddr='127.0.0.1'
-		set network.loopback.netmask='255.0.0.0'
-	EOF
-		[ -e /proc/sys/net/ipv6 ] && {
-			uci -q batch <<-EOF
-				delete network.globals
-				set network.globals='globals'
-				set network.globals.ula_prefix='auto'
-			EOF
-		}
-
-	if json_is_a dsl object; then
-		json_select dsl
-			if json_is_a atmbridge object; then
-				json_select atmbridge
-					local vpi vci encaps payload nameprefix
-					json_get_vars vpi vci encaps payload nameprefix
-					uci -q batch <<-EOF
-						delete network.atm
-						set network.atm='atm-bridge'
-						set network.atm.vpi='$vpi'
-						set network.atm.vci='$vci'
-						set network.atm.encaps='$encaps'
-						set network.atm.payload='$payload'
-						set network.atm.nameprefix='$nameprefix'
-					EOF
-				json_select ..
-			fi
-
-			if json_is_a modem object; then
-				json_select modem
-					local type annex firmware tone xfer_mode
-					json_get_vars type annex firmware tone xfer_mode
-					uci -q batch <<-EOF
-						delete network.dsl
-						set network.dsl='dsl'
-						set network.dsl.annex='$annex'
-						set network.dsl.firmware='$firmware'
-						set network.dsl.tone='$tone'
-						set network.dsl.xfer_mode='$xfer_mode'
-					EOF
-				json_select ..
-			fi
-		json_select ..
-	fi
-}
-
-addr_offset=2
-generate_network() {
-	local ports device macaddr protocol type ipaddr netmask vlan
-	local bridge=$2
-
-	json_select network
-		json_select "$1"
-			json_get_vars device macaddr metric protocol ipaddr netmask vlan
-			json_get_values ports ports
-		json_select ..
-	json_select ..
-
-	[ -n "$device" -o -n "$ports" ] || return
-
-	# Force bridge for "lan" as it may have other devices (e.g. wireless)
-	# bridged
-	[ "$1" = "lan" -a -z "$ports" ] && {
-		ports="$device"
-	}
-
-	[ -n "$ports" -a -z "$bridge" ] && {
-		uci -q batch <<-EOF
-			add network device
-			set network.@device[-1].name='br-$1'
-			set network.@device[-1].type='bridge'
-		EOF
-		for port in $ports; do uci add_list network.@device[-1].ports="$port"; done
-		[ -n "$macaddr" ] && {
-			for port in $ports; do
-				uci -q batch <<-EOF
-					add network device
-					set network.@device[-1].name='$port'
-					set network.@device[-1].macaddr='$macaddr'
-				EOF
-			done
-		}
-		device=br-$1
-		type=
-		macaddr=""
-	}
-
-	[ -n "$bridge" ] && {
-		[ -z "$ports" ] && ports="$device"
-		if [ -z "$vlan" ]; then
-			bridge_vlan_id=$((bridge_vlan_id + 1))
-			vlan=$bridge_vlan_id
-		fi
-		generate_bridge_vlan $1 $bridge "$ports" $vlan
-		device=$bridge.$vlan
-		type=""
-	}
-
-	if [ -n "$macaddr" ]; then
-		uci -q batch <<-EOF
-			add network device
-			set network.@device[-1].name='$device'
-			set network.@device[-1].macaddr='$macaddr'
-		EOF
-	fi
-
-	uci -q batch <<-EOF
-		delete network.$1
-		set network.$1='interface'
-		set network.$1.type='$type'
-		set network.$1.device='$device'
-		set network.$1.metric='$metric'
-		set network.$1.proto='none'
-	EOF
-
-	case "$protocol" in
-		static)
-			local ipad
-			case "$1" in
-				lan) ipad=${ipaddr:-"192.168.1.1"} ;;
-				*) ipad=${ipaddr:-"192.168.$((addr_offset++)).1"} ;;
-			esac
-
-			netm=${netmask:-"255.255.255.0"}
-
-			uci -q batch <<-EOF
-				set network.$1.proto='static'
-				set network.$1.ipaddr='$ipad'
-				set network.$1.netmask='$netm'
-			EOF
-			[ -e /proc/sys/net/ipv6 ] && uci set network.$1.ip6assign='60'
-		;;
-
-		dhcp)
-			# fixup IPv6 slave interface if parent is a bridge
-			[ "$type" = "bridge" ] && device="br-$1"
-
-			uci set network.$1.proto='dhcp'
-			[ -e /proc/sys/net/ipv6 ] && {
-				uci -q batch <<-EOF
-					delete network.${1}6
-					set network.${1}6='interface'
-					set network.${1}6.device='$device'
-					set network.${1}6.proto='dhcpv6'
-				EOF
-			}
-		;;
-
-		pppoe)
-			uci -q batch <<-EOF
-				set network.$1.proto='pppoe'
-				set network.$1.username='username'
-				set network.$1.password='password'
-			EOF
-			[ -e /proc/sys/net/ipv6 ] && {
-				uci -q batch <<-EOF
-					set network.$1.ipv6='1'
-					delete network.${1}6
-					set network.${1}6='interface'
-					set network.${1}6.device='@${1}'
-					set network.${1}6.proto='dhcpv6'
-				EOF
-			}
-		;;
-
-		ncm|\
-		qmi|\
-		mbim)
-			uci -q batch <<-EOF
-				set network.$1.proto='${protocol}'
-				set network.$1.pdptype='ipv4'
-			EOF
-		;;
-	esac
-}
-
-generate_switch_vlans_ports() {
-	local switch="$1"
-	local port ports role roles num attr val
-
-	#
-	# autogenerate vlans
-	#
-
-	if json_is_a roles array; then
-		json_get_keys roles roles
-		json_select roles
-
-		for role in $roles; do
-			json_select "$role"
-				json_get_vars ports
-			json_select ..
-
-			uci -q batch <<-EOF
-				add network switch_vlan
-				set network.@switch_vlan[-1].device='$switch'
-				set network.@switch_vlan[-1].vlan='$role'
-				set network.@switch_vlan[-1].ports='$ports'
-			EOF
-		done
-
-		json_select ..
-	fi
-
-
-	#
-	# write port specific settings
-	#
-
-	if json_is_a ports array; then
-		json_get_keys ports ports
-		json_select ports
-
-		for port in $ports; do
-			json_select "$port"
-				json_get_vars num
-
-				if json_is_a attr object; then
-					json_get_keys attr attr
-					json_select attr
-						uci -q batch <<-EOF
-							add network switch_port
-							set network.@switch_port[-1].device='$switch'
-							set network.@switch_port[-1].port=$num
-						EOF
-
-						for attr in $attr; do
-							json_get_var val "$attr"
-							uci -q set network.@switch_port[-1].$attr="$val"
-						done
-					json_select ..
-				fi
-			json_select ..
-		done
-
-		json_select ..
-	fi
-}
-
-generate_switch() {
-	local key="$1"
-	local vlans
-
-	json_select switch
-	json_select "$key"
-	json_get_vars enable reset blinkrate cpu_port \
-		ar8xxx_mib_type ar8xxx_mib_poll_interval
-
-	uci -q batch <<-EOF
-		add network switch
-		set network.@switch[-1].name='$key'
-		set network.@switch[-1].reset='$reset'
-		set network.@switch[-1].enable_vlan='$enable'
-		set network.@switch[-1].blinkrate='$blinkrate'
-		set network.@switch[-1].ar8xxx_mib_type='$ar8xxx_mib_type'
-		set network.@switch[-1].ar8xxx_mib_poll_interval='$ar8xxx_mib_poll_interval'
-	EOF
-
-	generate_switch_vlans_ports "$1"
-
-	json_select ..
-	json_select ..
-}
-
-generate_static_system() {
-	uci -q batch <<-EOF
-		delete system.@system[0]
-		add system system
-		set system.@system[-1].hostname='OpenWrt'
-		set system.@system[-1].timezone='UTC'
-		set system.@system[-1].ttylogin='0'
-		set system.@system[-1].log_size='64'
-		set system.@system[-1].urandom_seed='0'
-
-		delete system.ntp
-		set system.ntp='timeserver'
-		set system.ntp.enabled='1'
-		set system.ntp.enable_server='0'
-		add_list system.ntp.server='0.openwrt.pool.ntp.org'
-		add_list system.ntp.server='1.openwrt.pool.ntp.org'
-		add_list system.ntp.server='2.openwrt.pool.ntp.org'
-		add_list system.ntp.server='3.openwrt.pool.ntp.org'
-	EOF
-
-	if json_is_a system object; then
-		json_select system
-			local hostname
-			if json_get_var hostname hostname; then
-				uci -q set "system.@system[-1].hostname=$hostname"
-			fi
-
-			local compat_version
-			if json_get_var compat_version compat_version; then
-				uci -q set "system.@system[-1].compat_version=$compat_version"
-			else
-				uci -q set "system.@system[-1].compat_version=1.0"
-			fi
-
-			if json_is_a ntpserver array; then
-				local keys key
-				json_get_keys keys ntpserver
-				json_select ntpserver
-					uci -q delete "system.ntp.server"
-
-					for key in $keys; do
-						local server
-						if json_get_var server "$key"; then
-							uci -q add_list "system.ntp.server=$server"
-						fi
-					done
-				json_select ..
-			fi
-		json_select ..
-	fi
-}
-
-generate_rssimon() {
-	local key="$1"
-	local cfg="rssid_$key"
-	local refresh threshold
-
-	json_select rssimon
-	json_select "$key"
-	json_get_vars refresh threshold
-	json_select ..
-	json_select ..
-
-	uci -q batch <<-EOF
-		delete system.$cfg
-		set system.$cfg='rssid'
-		set system.$cfg.dev='$key'
-		set system.$cfg.refresh='$refresh'
-		set system.$cfg.threshold='$threshold'
-	EOF
-}
-
-generate_led() {
-	local key="$1"
-	local cfg="led_$key"
-
-	json_select led
-	json_select "$key"
-	json_get_vars name sysfs type trigger default
-
-	uci -q batch <<-EOF
-		delete system.$cfg
-		set system.$cfg='led'
-		set system.$cfg.name='$name'
-		set system.$cfg.sysfs='$sysfs'
-		set system.$cfg.trigger='$trigger'
-		set system.$cfg.default='$default'
-	EOF
-
-	case "$type" in
-		gpio)
-			local gpio inverted
-			json_get_vars gpio inverted
-			uci -q batch <<-EOF
-				set system.$cfg.trigger='gpio'
-				set system.$cfg.gpio='$gpio'
-				set system.$cfg.inverted='$inverted'
-			EOF
-		;;
-
-		netdev)
-			local device mode
-			json_get_vars device mode
-			uci -q batch <<-EOF
-				set system.$cfg.trigger='netdev'
-				set system.$cfg.mode='$mode'
-				set system.$cfg.dev='$device'
-			EOF
-		;;
-
-		usb)
-			local device
-			json_get_vars device
-			uci -q batch <<-EOF
-				set system.$cfg.trigger='usbdev'
-				set system.$cfg.interval='50'
-				set system.$cfg.dev='$device'
-			EOF
-		;;
-
-		usbport)
-			local ports port
-			json_get_values ports ports
-			uci set system.$cfg.trigger='usbport'
-			for port in $ports; do
-				uci add_list system.$cfg.port=$port
-			done
-		;;
-
-		rssi)
-			local iface minq maxq offset factor
-			json_get_vars iface minq maxq offset factor
-			uci -q batch <<-EOF
-				set system.$cfg.trigger='rssi'
-				set system.$cfg.iface='rssid_$iface'
-				set system.$cfg.minq='$minq'
-				set system.$cfg.maxq='$maxq'
-				set system.$cfg.offset='$offset'
-				set system.$cfg.factor='$factor'
-			EOF
-		;;
-
-		switch)
-			local port_mask speed_mask mode
-			json_get_vars port_mask speed_mask mode
-			uci -q batch <<-EOF
-				set system.$cfg.port_mask='$port_mask'
-				set system.$cfg.speed_mask='$speed_mask'
-				set system.$cfg.mode='$mode'
-			EOF
-		;;
-
-		portstate)
-			local port_state
-			json_get_vars port_state
-			uci -q batch <<-EOF
-				set system.$cfg.port_state='$port_state'
-			EOF
-		;;
-
-		timer|oneshot)
-			local delayon delayoff
-			json_get_vars delayon delayoff
-			uci -q batch <<-EOF
-				set system.$cfg.trigger='$type'
-				set system.$cfg.delayon='$delayon'
-				set system.$cfg.delayoff='$delayoff'
-			EOF
-		;;
-	esac
-
-	json_select ..
-	json_select ..
-}
-
-generate_gpioswitch() {
-	local cfg="$1"
-
-	json_select gpioswitch
-		json_select "$cfg"
-			local name pin default
-			json_get_vars name pin default
-			uci -q batch <<-EOF
-				delete system.$cfg
-				set system.$cfg='gpio_switch'
-				set system.$cfg.name='$name'
-				set system.$cfg.gpio_pin='$pin'
-				set system.$cfg.value='$default'
-			EOF
-		json_select ..
-	json_select ..
-}
-
-json_init
-json_load "$(cat ${CFG})"
-
-umask 077
-
-if [ ! -s /etc/config/network ]; then
-	bridge_name=""
-	touch /etc/config/network
-	generate_static_network
-
-	json_get_vars bridge
-	[ -n "$bridge" ] && {
-		json_select bridge
-		json_get_vars name macaddr
-		generate_bridge "$name" "$macaddr"
-		json_select ..
-		bridge_name=$name
-	}
-
-	json_get_keys keys network
-	for key in $keys; do generate_network $key $bridge_name; done
-
-	json_get_keys keys switch
-	for key in $keys; do generate_switch $key; done
-fi
-
-if [ ! -s /etc/config/system ]; then
-	touch /etc/config/system
-	generate_static_system
-
-	json_get_keys keys rssimon
-	for key in $keys; do generate_rssimon $key; done
-
-	json_get_keys keys gpioswitch
-	for key in $keys; do generate_gpioswitch $key; done
-
-	json_get_keys keys led
-	for key in $keys; do generate_led $key; done
-fi
-uci commit
diff --git target/linux/ramips/dts/mt7628an_i_gateway-7628.dts target/linux/ramips/dts/mt7628an_i_gateway-7628.dts
new file mode 100644
index 0000000000..30e68884da
--- /dev/null
+++ target/linux/ramips/dts/mt7628an_i_gateway-7628.dts
@@ -0,0 +1,217 @@
+#include "mt7628an.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "i,gateway-7628", "mediatek,mt7628an-soc";
+	model = "I Gateway 7628";
+
+	aliases {
+		led-boot = &led_status;
+		led-failsafe = &led_status;
+		led-upgrade = &led_status;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_status: status {
+			label = "status";
+			gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_wled: wled {
+			label = "wled";
+			gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	gpio-export {
+		compatible = "gpio-export";
+
+		button-4 {
+			gpio-export,name = "button-4";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		};
+
+		button-3 {
+			gpio-export,name = "button-3";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+		};
+
+		button-2 {
+			gpio-export,name = "button-2";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+		};
+
+		button-1 {
+			gpio-export,name = "button-1";
+			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+		};
+
+		cc-boot {
+			gpio-export,name = "cc-boot";
+			gpio-export,output = <1>;
+			gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
+		};
+
+		cc-reset {
+			gpio-export,name = "cc-reset";
+			gpio-export,output = <1>;
+			gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
+		};
+
+		shift {
+			gpio-export,name = "shift";
+			gpio-export,output = <1>;
+			gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
+		};
+
+		open {
+			gpio-export,name = "open";
+			gpio-export,output = <0>;
+			gpios = <&hc595 1 GPIO_ACTIVE_HIGH>;
+		};
+
+		close {
+			gpio-export,name = "close";
+			gpio-export,output = <0>;
+			gpios = <&hc595 2 GPIO_ACTIVE_HIGH>;
+		};
+
+		valve {
+			gpio-export,name = "valve";
+			gpio-export,output = <0>;
+			gpios = <&hc595 3 GPIO_ACTIVE_HIGH>;
+		};
+
+		relay {
+			gpio-export,name = "relay";
+			gpio-export,output = <0>;
+			gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	onewire {
+		compatible = "w1-gpio";
+		gpios = <&gpio 3 GPIO_OPEN_DRAIN>;
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "i2s", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "wdt", "wled_an";
+		function = "gpio";
+	};
+};
+
+&pwm {
+	pinctrl-0 = <&pwm0_pins>;
+	status = "okay";
+
+	beeper: beeper@0 {
+		pwms = <&pwm 0 400000>;
+		pwm-names = "beeper";
+	};
+};
+
+&uart1 {
+	status = "okay";
+};
+
+&uart2 {
+	status = "okay";
+};
+
+&i2c {
+	status = "okay";
+
+	pcf8563: pcf8563@51 {
+		compatible = "nxp,pcf8563";
+		reg = <0x51>;
+		status = "okay";
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
+
+	flash: flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+		broken-flash-reset;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "u-boot";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition@30000 {
+				label = "u-boot-env";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			factory: partition@40000 {
+				label = "factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			partition@50000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x50000 0x1fb0000>;
+			};
+		};
+	};
+
+	hc595: hc595@1 {
+		compatible = "fairchild,74hc595";
+		reg = <1>;
+		registers-number = <4>;
+		spi-max-frequency = <100000>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+};
+
+&ethernet {
+	nvmem-cells = <&macaddr_factory_28>;
+	nvmem-cell-names = "mac-address";
+};
+
+&esw {
+	mediatek,portmap = <0x3e>;
+};
+
+&sdhci {
+	status = "okay";
+};
+
+&wmac {
+	status = "okay";
+	mediatek,mtd-eeprom = <&factory 0x0>;
+};
+
+&factory {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_factory_28: macaddr@28 {
+		reg = <0x28 0x6>;
+	};
+};
diff --git target/linux/ramips/image/mt76x8.mk target/linux/ramips/image/mt76x8.mk
index 5b9a04d6f2..0ce38b662a 100644
--- target/linux/ramips/image/mt76x8.mk
+++ target/linux/ramips/image/mt76x8.mk
@@ -28,7 +28,6 @@ define Build/ravpower-wd009-factory
 	@mv $@.new $@
 endef
 
-
 define Device/alfa-network_awusfree1
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := ALFA Network
@@ -289,6 +288,16 @@ define Device/hiwifi_hc5861b
 endef
 TARGET_DEVICES += hiwifi_hc5861b
 
+define Device/i_gateway-7628
+  IMAGE_SIZE := 32448k
+  DEVICE_VENDOR := I
+  DEVICE_MODEL := Gateway 7628
+  DEVICE_PACKAGES := kmod-i2c-mt7628 kmod-pwm-mediatek-ramips \
+	kmod-sdhci-mt7620 kmod-rtc-pcf8563 \
+	 kmod-w1 kmod-w1-master-gpio kmod-w1-slave-therm
+endef
+TARGET_DEVICES += i_gateway-7628
+
 define Device/iptime_a3
   IMAGE_SIZE := 7936k
   UIMAGE_NAME := a3
diff --git target/linux/ramips/mt76x8/base-files/etc/config/dhcp target/linux/ramips/mt76x8/base-files/etc/config/dhcp
new file mode 100644
index 0000000000..41d64bdd58
--- /dev/null
+++ target/linux/ramips/mt76x8/base-files/etc/config/dhcp
@@ -0,0 +1,36 @@
+config dnsmasq
+	option domainneeded '1'
+	option boguspriv '1'
+	option filterwin2k '0'
+	option localise_queries '1'
+	option rebind_protection '1'
+	option rebind_localhost '1'
+	option local '/lan/'
+	option domain 'lan'
+	option expandhosts '1'
+	option nonegcache '0'
+	option authoritative '1'
+	option readethers '1'
+	option leasefile '/tmp/dhcp.leases'
+	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
+	option nonwildcard '1'
+	option localservice '1'
+	option ednspacket_max '1232'
+
+config dhcp 'lan'
+	option interface 'lan1'
+	option start '100'
+	option limit '150'
+	option leasetime '12h'
+	option dhcpv4 'server'
+	option ignore '0'
+
+config dhcp 'wan'
+	option interface 'wan'
+	option ignore '1'
+
+config odhcpd 'odhcpd'
+	option maindhcp '0'
+	option leasefile '/tmp/hosts/odhcpd'
+	option leasetrigger '/usr/sbin/odhcpd-update'
+	option loglevel '4'
diff --git target/linux/ramips/mt76x8/base-files/etc/config/network target/linux/ramips/mt76x8/base-files/etc/config/network
new file mode 100644
index 0000000000..5069e89a42
--- /dev/null
+++ target/linux/ramips/mt76x8/base-files/etc/config/network
@@ -0,0 +1,17 @@
+config interface 'loopback'
+	option device 'lo'
+	option proto 'static'
+	option ipaddr '127.0.0.1'
+	option netmask '255.0.0.0'
+
+config interface 'lan1'
+	option proto 'static'
+	option ipaddr '192.168.44.1'
+	option netmask '255.255.255.0'
+
+config interface 'lan2'
+	option device 'eth0'
+	option proto 'dhcp'
+
+config interface 'wlan'
+	option proto 'dhcp'
diff --git target/linux/ramips/mt76x8/base-files/etc/config/system target/linux/ramips/mt76x8/base-files/etc/config/system
new file mode 100644
index 0000000000..44fa2f825d
--- /dev/null
+++ target/linux/ramips/mt76x8/base-files/etc/config/system
@@ -0,0 +1,11 @@
+config system
+    option ttylogin '1'
+    option log_size '64'
+    option urandom_seed '0'
+    option timezone 'UTC'
+
+config timeserver 'ntp'
+    list server '0.openwrt.pool.ntp.org'
+    list server '1.openwrt.pool.ntp.org'
+    list server '2.openwrt.pool.ntp.org'
+    list server '3.openwrt.pool.ntp.org'
diff --git target/linux/ramips/mt76x8/base-files/etc/opkg/customfeeds.conf target/linux/ramips/mt76x8/base-files/etc/opkg/customfeeds.conf
new file mode 100644
index 0000000000..adc47f4575
--- /dev/null
+++ target/linux/ramips/mt76x8/base-files/etc/opkg/customfeeds.conf
@@ -0,0 +1,2 @@
+src/gz homed_packages https://opkg.homed.dev/mipsel_24kc
+src/gz i_packages https://opkg.vse-i.ru/mipsel_24kc
diff --git target/linux/ramips/mt76x8/base-files/etc/opkg/keys/0ac0b11f6104c5a0 target/linux/ramips/mt76x8/base-files/etc/opkg/keys/0ac0b11f6104c5a0
new file mode 100644
index 0000000000..bfc38c8b47
--- /dev/null
+++ target/linux/ramips/mt76x8/base-files/etc/opkg/keys/0ac0b11f6104c5a0
@@ -0,0 +1,2 @@
+untrusted comment: HOMEd opkg feed public key
+RWQKwLEfYQTFoGw6OO9C2dR/mNZgqDttqq75oDK/UX0TL9XWqfx3+TcQ
diff --git target/linux/ramips/mt76x8/base-files/etc/shadow target/linux/ramips/mt76x8/base-files/etc/shadow
new file mode 100644
index 0000000000..e241be75fd
--- /dev/null
+++ target/linux/ramips/mt76x8/base-files/etc/shadow
@@ -0,0 +1,10 @@
+root:$5$LrmPmiWK7xj/m3jA$C7UDcdY1VSyHO4ro0EOQsaUCTMJT/ueNAEZfQPRc/qA:20122:0:99999:7:::
+daemon:*:0:0:99999:7:::
+ftp:*:0:0:99999:7:::
+network:*:0:0:99999:7:::
+nobody:*:0:0:99999:7:::
+ntp:x:0:0:99999:7:::
+dnsmasq:x:0:0:99999:7:::
+logd:x:0:0:99999:7:::
+mosquitto:x:0:0:99999:7:::
+ubus:x:0:0:99999:7:::
diff --git target/linux/ramips/mt76x8/base-files/etc/uci-defaults/10_basic-setup target/linux/ramips/mt76x8/base-files/etc/uci-defaults/10_basic-setup
new file mode 100644
index 0000000000..5c7bd5ab61
--- /dev/null
+++ target/linux/ramips/mt76x8/base-files/etc/uci-defaults/10_basic-setup
@@ -0,0 +1,17 @@
+. /lib/functions/system.sh
+
+hostname="i-gateway-$(mtd_get_mac_binary factory 0x28 | cut -d ":" -f 3-6 | sed 's/\://g')"
+
+uci add_list firewall.@zone[0].network=lan1
+uci add_list firewall.@zone[0].network=lan2
+uci add_list firewall.@zone[0].network=wlan
+uci commit firewall
+
+uci set system.@system[0].hostname=${hostname}
+uci set system.@system[0].ttylogin=1
+uci commit system
+
+uci set wireless.radio0.disabled=0
+uci set wireless.@wifi-iface[0].network=lan1
+uci set wireless.@wifi-iface[0].ssid=${hostname}
+uci commit wireless
diff --git target/linux/ramips/mt76x8/base-files/opt/scripts/wifi.sh target/linux/ramips/mt76x8/base-files/opt/scripts/wifi.sh
new file mode 100755
index 0000000000..ffff1ad8c8
--- /dev/null
+++ target/linux/ramips/mt76x8/base-files/opt/scripts/wifi.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+uci set wireless.client_radio0=wifi-iface
+uci set wireless.client_radio0.disabled=0
+uci set wireless.client_radio0.encryption=psk2
+uci set wireless.client_radio0.device=radio0
+uci set wireless.client_radio0.mode=sta
+uci set wireless.client_radio0.network=wlan
+uci set wireless.client_radio0.ssid=$1
+uci set wireless.client_radio0.key=$2
+
+uci commit wireless
+wifi
diff --git target/linux/ramips/mt76x8/config-5.15 target/linux/ramips/mt76x8/config-5.15
index 7248aa6633..cd0e190436 100644
--- target/linux/ramips/mt76x8/config-5.15
+++ target/linux/ramips/mt76x8/config-5.15
@@ -27,6 +27,7 @@ CONFIG_CPU_MIPS32=y
 CONFIG_CPU_MIPS32_R2=y
 CONFIG_CPU_MIPSR2=y
 CONFIG_CPU_MIPSR2_IRQ_VI=y
+CONFIG_CPU_MITIGATIONS=y
 CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
 CONFIG_CPU_R4K_CACHE_TLB=y
 CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
@@ -45,6 +46,7 @@ CONFIG_DTB_RT_NONE=y
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_FIXED_PHY=y
+CONFIG_FUNCTION_ALIGNMENT=0
 CONFIG_FWNODE_MDIO=y
 CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_GENERIC_ATOMIC64=y
@@ -69,6 +71,7 @@ CONFIG_GENERIC_SCHED_CLOCK=y
 CONFIG_GENERIC_SMP_IDLE_THREAD=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GPIOLIB_IRQCHIP=y
+CONFIG_GPIO_74X164=y
 CONFIG_GPIO_CDEV=y
 CONFIG_GPIO_GENERIC=y
 CONFIG_GPIO_MT7621=y
