Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync with main 3/12 #178

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions include/meson.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,14 @@ else
MESON_CPU:="$(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))"
endif

ifeq ($(MESON_USE_STAGING_PYTHON),)
PYTHON_BIN:=$(STAGING_DIR_HOST)/bin/$(PYTHON)
else
PYTHON_BIN:=$(STAGING_DIR_HOSTPKG)/bin/$(PYTHON)
endif

define Meson
$(2) $(STAGING_DIR_HOST)/bin/$(PYTHON) $(STAGING_DIR_HOST)/bin/meson.py $(1)
$(2) $(PYTHON_BIN) $(STAGING_DIR_HOST)/bin/meson.py $(1)
endef

define Meson/CreateNativeFile
Expand All @@ -65,7 +71,7 @@ define Meson/CreateNativeFile
-e "s|@CXX@|$(foreach BIN,$(HOSTCXX),'$(BIN)',)|" \
-e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \
-e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \
-e "s|@PYTHON@|$(STAGING_DIR_HOST)/bin/python3|" \
-e "s|@PYTHON@|$(PYTHON_BIN)|" \
-e "s|@CFLAGS@|$(foreach FLAG,$(HOST_CFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \
-e "s|@CXXFLAGS@|$(foreach FLAG,$(HOST_CXXFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \
-e "s|@LDFLAGS@|$(foreach FLAG,$(HOST_LDFLAGS),'$(FLAG)',)|" \
Expand All @@ -84,7 +90,7 @@ define Meson/CreateCrossFile
-e "s|@NM@|$(TARGET_NM)|" \
-e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \
-e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \
-e "s|@PYTHON@|$(STAGING_DIR_HOST)/bin/python3|" \
-e "s|@PYTHON@|$(PYTHON_BIN)|" \
-e "s|@CFLAGS@|$(foreach FLAG,$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \
-e "s|@CXXFLAGS@|$(foreach FLAG,$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \
-e "s|@LDFLAGS@|$(foreach FLAG,$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS),'$(FLAG)',)|" \
Expand Down
1 change: 1 addition & 0 deletions include/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ define BuildTargets/DumpCurrent
echo 'Target-Description:'; \
echo "$$$$DESCRIPTION"; \
echo '@@'; \
$(if $(DEFAULT_PROFILE),echo 'Target-Default-Profile: $(DEFAULT_PROFILE)';) \
echo 'Default-Packages: $(DEFAULT_PACKAGES) $(call extra_packages,$(DEFAULT_PACKAGES))'; \
$(DUMPINFO)
$(if $(CUR_SUBTARGET),$(SUBMAKE) -r --no-print-directory -C image -s DUMP=1 SUBTARGET=$(CUR_SUBTARGET))
Expand Down
17 changes: 1 addition & 16 deletions include/toplevel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,7 @@ endif

_ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))

# Config that will invalidate the .targetinfo as they will affect
# DEFAULT_PACKAGES.
# Keep DYNAMIC_DEF_PKG_CONF in sync with target.mk to reflect the same configs
DYNAMIC_DEF_PKG_CONF := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_USE_SECCOMP
check-dynamic-def-pkg: FORCE
@+DEF_PKG_CONFS=""; \
if [ -f $(TOPDIR)/.config ]; then \
for config in $(DYNAMIC_DEF_PKG_CONF); do \
DEF_PKG_CONFS="$$DEF_PKG_CONFS "$$(grep "$$config"=y $(TOPDIR)/.config); \
done; \
fi; \
[ ! -f tmp/.packagedynamicdefault ] || OLD_DEF_PKG_CONFS=$$(cat tmp/.packagedynamicdefault); \
[ "$$DEF_PKG_CONFS" = "$$OLD_DEF_PKG_CONFS" ] || rm -rf tmp/info/.targetinfo*; \
mkdir -p tmp && echo "$$DEF_PKG_CONFS" > tmp/.packagedynamicdefault;

prepare-tmpinfo: check-dynamic-def-pkg FORCE
prepare-tmpinfo: FORCE
@+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK)
mkdir -p tmp/info feeds
[ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base
Expand Down
28 changes: 28 additions & 0 deletions package/base-files/files/etc/init.d/led
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

START=96

extra_command "turnon" "Put the LEDs into their default state"
extra_command "turnoff" "Turn all LEDs off"
extra_command "blink" "Blink all LEDs"

led_color_set() {
local cfg="$1"
local sysfs="$2"
Expand Down Expand Up @@ -168,7 +172,31 @@ load_led() {
}
}

turnoff() {
for led in `ls /sys/class/leds/`; do
echo 0 > /sys/class/leds/$led/brightness
done
}

turnon() {
turnoff
. /etc/diag.sh
set_state done
start
}

blink() {
for led in `ls /sys/class/leds/`; do
echo 0 > /sys/class/leds/$led/brightness
echo timer > /sys/class/leds/$led/trigger
done
}

start() {
[ "$(uci -q get system.@system[-1].leds_off)" = '1' ] && {
turnoff
exit 0
}
[ -e /sys/class/leds/ ] && {
[ -s /var/run/led.state ] && {
local led trigger brightness color
Expand Down
2 changes: 1 addition & 1 deletion package/base-files/files/etc/rc.button/reset
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ released)
elif [ "$SEEN" -ge 5 -a -n "$OVERLAY" ]
then
echo "FACTORY RESET" > /dev/console
jffs2reset -y && reboot &
factoryreset -y && reboot &
fi
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion package/base-files/files/sbin/firstboot
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

/sbin/jffs2reset $@
/sbin/factoryreset $@
6 changes: 4 additions & 2 deletions package/boot/uboot-mediatek/patches/453-add-openwrt-one.patch
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
+CONFIG_LMB_MAX_REGIONS=64
--- /dev/null
+++ b/openwrt-one-nor_env
@@ -0,0 +1,47 @@
@@ -0,0 +1,48 @@
+ethaddr_factory=mtd read factory 0x46000000 0x0 0x20000 && env readmem -b ethaddr 0x4600002a 0x6 ; setenv ethaddr_factory
+bl2_mtd_write=mtd erase bl2-nor && mtd write bl2-nor $loadaddr 0x0 0x40000
+bl2_tftp_write=tftpboot $loadaddr $bootfile_bl2_nor && run bl2_mtd_write
Expand Down Expand Up @@ -510,6 +510,7 @@
+serverip=192.168.11.23
+tftp_boot=run led_start ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
+tftp_write=run led_start ; tftpboot $loadaddr $bootfile && mtd erase recovery 0x0 ${filesize} && mtd write recovery $loadaddr 0x0 ${filesize}
+usb_pgood_delay=4000
+usb_recovery=run led_start ; usb start && run usb_recovery_bl2 && run usb_recovery_ubi && run led_loop_done
+usb_recovery_bl2=fatload usb 0:1 ${loadaddr} ${recoverfile_bl2} && run recovery_write_bl2
+usb_recovery_ubi=fatload usb 0:1 ${loadaddr} ${recoverfile_ubi} && run recovery_write_ubi
Expand All @@ -519,7 +520,7 @@
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver"
--- /dev/null
+++ b/openwrt-one-spi-nand_env
@@ -0,0 +1,60 @@
@@ -0,0 +1,61 @@
+ethaddr_factory=mtd read factory 0x46000000 0x0 0x20000 && env readmem -b ethaddr 0x4600002a 0x6 ; setenv ethaddr_factory
+ipaddr=192.168.11.11
+serverip=192.168.11.23
Expand Down Expand Up @@ -571,6 +572,7 @@
+ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
+ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
+ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
+usb_pgood_delay=4000
+usb_recover=run led_start ; usb start && run usb_recover_production && run led_loop_done
+usb_recover_production=fatload usb 0:1 ${loadaddr} ${bootfile_upg} && iminfo $loadaddr && run ubi_write_production
+ubi_write_fip=run ubi_remove_rootfs ; ubi check fip && ubi remove fip ; ubi create fip $filesize static && ubi write $loadaddr fip $filesize
Expand Down
2 changes: 1 addition & 1 deletion package/kernel/mac80211/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ PKG_CONFIG_DEPENDS += \
define KernelPackage/cfg80211
$(call KernelPackage/mac80211/Default)
TITLE:=cfg80211 - wireless configuration API
DEPENDS+= +iw +iwinfo +wifi-scripts +wireless-regdb +USE_RFKILL:kmod-rfkill
DEPENDS+= +iw +!WIFI_SCRIPTS_UCODE:iwinfo +wifi-scripts +wireless-regdb +USE_RFKILL:kmod-rfkill
ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
FILES:= \
$(PKG_BUILD_DIR)/compat/compat.ko \
Expand Down
3 changes: 3 additions & 0 deletions package/network/config/wifi-scripts/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config WIFI_SCRIPTS_UCODE
bool "Use new ucode based scripts"
default n
10 changes: 9 additions & 1 deletion package/network/config/wifi-scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@ PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0

PKG_MAINTAINER:=Felix Fietkau <[email protected]>
PKG_CONFIG_DEPENDS:=CONFIG_WIFI_SCRIPTS_UCODE

include $(INCLUDE_DIR)/package.mk

define Package/wifi-scripts
SECTION:=utils
CATEGORY:=Base system
DEPENDS:=+netifd +ucode +ucode-mod-nl80211 +ucode-mod-rtnl +ucode-mod-ubus +ucode-mod-uci
DEPENDS:=+netifd +ucode +ucode-mod-nl80211 +ucode-mod-rtnl +ucode-mod-ubus +ucode-mod-uci +ucode-mod-digest
TITLE:=Wi-Fi configuration scripts
PKGARCH:=all
endef

define Package/wifi-scripts/config
source "$(SOURCE)/Config.in"
endef

define Package/wifi-scripts/description
A set of scripts that handle setup and configuration of Wi-Fi devices.
endef
Expand All @@ -40,6 +45,9 @@ endef
define Package/wifi-scripts/install
$(INSTALL_DIR) $(1)
$(CP) ./files/* $(1)/
ifeq ($(CONFIG_WIFI_SCRIPTS_UCODE),y)
$(CP) ./files-ucode/* $(1)/
endif
endef

$(eval $(call BuildPackage,wifi-scripts))
Loading
Loading