kiddin9 3 жил өмнө
parent
commit
5dfeff63cb

+ 19 - 28
devices/common/patches/opkginstall.patch

@@ -150,45 +150,36 @@
  						opkg="$opkg $1"
  						shift
  					;;
-@@ -34,9 +34,19 @@ case "$action" in
- 
+@@ -35,8 +35,28 @@ case "$action" in
  			if flock -x 200; then
  				$opkg $action "$@" </dev/null >/tmp/opkg.out 2>/tmp/opkg.err
+ 				code=$?
+-				stdout=$(cat /tmp/opkg.out)
 +				if [[ $@ == luci-app-* && "$(opkg list | grep luci-i18n-"$(echo $@ | cut -d - -f 3-4)"-zh-cn)" ]]; then
 +					$opkg $action luci-i18n-"$(echo $@ | cut -d - -f 3-4)"-zh-cn </dev/null >>/tmp/opkg.out 2>/dev/null
 +				fi
-+				sed -i -e "/resolve_conffiles/d" \
-+				       -e "/uci: Entry not found/d" \
-+				       -e "/Existing conffile/d" \
-+				       -e "/Couldn't unlink/d" \
-+				       -e "/cannot find dependency kernel/d" \
-+				       -e "/^Collected errors:\(\nCollected errors:\)*$/d" /tmp/opkg.err || true
- 				code=$?
--				stdout=$(cat /tmp/opkg.out)
++				case "$action" in
++					install)
++						[ "$(opkg list-installed | cut -f 1 -d ' ' | grep -w $@)" ] && {
++							rm -f /tmp/opkg.err
++						}
++						[[ "$(opkg list-installed | cut -f 1 -d ' ' | grep -w $@)" && ! "$(cat /etc/backup/user_installed.opkg | grep -w $@)" ]] && {
++							echo $@ >>/etc/backup/user_installed.opkg
++						}
++					;;
++					remove)
++						[ ! "$(opkg list-installed | cut -f 1 -d ' ' | grep -w $@)" ] && {
++							rm -f /tmp/opkg.err
++						}
++						sed -i "/^$@$/d" /etc/backup/user_installed.opkg
++					;;
++				esac
  				stderr=$(cat /tmp/opkg.err)
 +				[ -n "$stderr" ] || echo "🎉 已完成, 请关闭本窗口~" >>/tmp/opkg.out
 +				stdout=$(cat /tmp/opkg.out)
  			else
  				code=255
  				stderr="Failed to acquire lock"
-@@ -47,6 +57,17 @@ case "$action" in
- 			[ -n "$stdout" ] && json_add_string stdout "$stdout"
- 			[ -n "$stderr" ] && json_add_string stderr "$stderr"
- 			json_dump
-+
-+		case "$action" in
-+			install)
-+				[[ "$(opkg list-installed | cut -f 1 -d ' ' | grep $@)" && ! "$(cat /etc/backup/user_installed.opkg | grep ^$@$)" ]] && {
-+				echo $@ >>/etc/backup/user_installed.opkg
-+				}
-+			;;
-+			remove)
-+				sed -i "/^$@$/d" /etc/backup/user_installed.opkg
-+			;;
-+		esac
- 		) 200>/tmp/opkg.lock
- 
- 		rm -f /tmp/opkg.lock /tmp/opkg.err /tmp/opkg.out
 
 --- a/package/feeds/luci/luci-app-opkg/root/usr/share/rpcd/acl.d/luci-app-opkg.json
 +++ b/package/feeds/luci/luci-app-opkg/root/usr/share/rpcd/acl.d/luci-app-opkg.json

+ 12 - 0
devices/x86_64/patches/def_set_interfaces_lan_wan.patch

@@ -0,0 +1,12 @@
+--- a/target/linux/x86/base-files/etc/board.d/02_network
++++ b/target/linux/x86/base-files/etc/board.d/02_network
+@@ -22,6 +22,9 @@ traverse-technologies-geos)
+ 	macaddr="$(cat /sys/class/net/eth0/address)" 2>/dev/null
+ 	[ -n "$macaddr" ] && ucidef_set_interface_macaddr "wan" "$macaddr"
+ 	;;
++*)
++	ucidef_set_interfaces_lan_wan "$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -vE "(@|\.|eth1)" | tr "\n" " " | sed "s/ $//")" "eth1"
++	;;
+ esac
+ board_config_flush
+