Skip to content

Commit

Permalink
Merge branch 'openwrt-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sandro committed Mar 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 94f5254 + e9b7af7 commit 3f1246e
Showing 2,700 changed files with 113,403 additions and 87,196 deletions.
15 changes: 0 additions & 15 deletions config/Config-kernel.in
Original file line number Diff line number Diff line change
@@ -1184,21 +1184,6 @@ config KERNEL_XDP_SOCKETS
XDP sockets allows a channel between XDP programs and
userspace applications.

config KERNEL_WIRELESS_EXT
def_bool n

config KERNEL_WEXT_CORE
def_bool KERNEL_WIRELESS_EXT

config KERNEL_WEXT_PRIV
def_bool KERNEL_WIRELESS_EXT

config KERNEL_WEXT_PROC
def_bool KERNEL_WIRELESS_EXT

config KERNEL_WEXT_SPY
def_bool KERNEL_WIRELESS_EXT

config KERNEL_PAGE_POOL
def_bool n

14 changes: 14 additions & 0 deletions include/image-commands.mk
Original file line number Diff line number Diff line change
@@ -152,6 +152,20 @@ define Build/append-ubi
$(call Build/check-size,$(UBI_NAND_SIZE_LIMIT)))
endef

define Build/ubinize-image
sh $(TOPDIR)/scripts/ubinize-image.sh \
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
$(foreach part,$(UBINIZE_PARTS),--part $(part)) \
--part $(word 1,$(1))="$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(word 2,$(1))" \
$@.tmp \
-p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
$(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
$(if $(VID_HDR_OFFSET),-O $(VID_HDR_OFFSET)) \
$(UBINIZE_OPTS)
cat $@.tmp >> $@
rm $@.tmp
endef

define Build/ubinize-kernel
cp $@ $@.tmp
sh $(TOPDIR)/scripts/ubinize-image.sh \
10 changes: 6 additions & 4 deletions include/image.mk
Original file line number Diff line number Diff line change
@@ -582,7 +582,7 @@ define Device/Build/dtb
$(KDIR)/image-$(1).dtb: FORCE
$(call Image/BuildDTB,$(strip $(2))/$(strip $(3)).dts,$$@)

image_prepare: $(KDIR)/image-$(1).dtb
compile-dtb: $(KDIR)/image-$(1).dtb
endif

endef
@@ -593,7 +593,7 @@ define Device/Build/dtbo
$(KDIR)/image-$(1).dtbo: FORCE
$(call Image/BuildDTBO,$(strip $(2))/$(strip $(3)).dtso,$$@)

image_prepare: $(KDIR)/image-$(1).dtbo
compile-dtb: $(KDIR)/image-$(1).dtbo
endif

endef
@@ -841,18 +841,20 @@ define BuildImage
download:
prepare:
compile:
compile-dtb:
clean:
image_prepare:

ifeq ($(IB),)
.PHONY: download prepare compile clean image_prepare kernel_prepare install install-images
.PHONY: download prepare compile compile-dtb clean image_prepare kernel_prepare install install-images
compile:
$(call Build/Compile)

clean:
$(call Build/Clean)

image_prepare: compile
compile-dtb:
image_prepare: compile compile-dtb
mkdir -p $(BIN_DIR) $(KDIR)/tmp
rm -rf $(BUILD_DIR)/json_info_files
$(call Image/Prepare)
4 changes: 2 additions & 2 deletions include/kernel-5.15
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .147
LINUX_KERNEL_HASH-5.15.147 = 56c1e65625d201db431efda7a3816e7b424071e7cb0245b2ba594d15b1fdfcd4
LINUX_VERSION-5.15 = .148
LINUX_KERNEL_HASH-5.15.148 = c48575c97fd9f4767cbe50a13b1b2b40ee42830aba3182fabd35a03259a6e5d8
4 changes: 2 additions & 2 deletions include/kernel-6.1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-6.1 = .74
LINUX_KERNEL_HASH-6.1.74 = b7fbd1d79faed2ce3570ef79dc1223e4e19c868b86326b14a435db56ebbb2022
LINUX_VERSION-6.1 = .79
LINUX_KERNEL_HASH-6.1.79 = faa49ca22fb55ed4d5ca2a55e07dd10e4e171cfc3b92568a631453cd2068b39b
4 changes: 4 additions & 0 deletions include/kernel-build.mk
Original file line number Diff line number Diff line change
@@ -156,6 +156,10 @@ define BuildKernel
compile: $(LINUX_DIR)/.modules
$(MAKE) -C image compile TARGET_BUILD=

dtb: $(STAMP_CONFIGURED)
$(_SINGLE)$(KERNEL_MAKE) scripts_dtc
$(MAKE) -C image compile-dtb TARGET_BUILD=

oldconfig menuconfig nconfig xconfig: $(STAMP_PREPARED) $(STAMP_CHECKED) FORCE
rm -f $(LINUX_DIR)/.config.prev
rm -f $(STAMP_CONFIGURED)
2 changes: 1 addition & 1 deletion include/package-defaults.mk
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ define Package/Default
PROVIDES:=
EXTRA_DEPENDS:=
MAINTAINER:=$(PKG_MAINTAINER)
SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
SOURCE:=$(patsubst $(TOPDIR)/%,%,$(patsubst $(TOPDIR)/package/%,feeds/base/%,$(CURDIR)))
ifneq ($(PKG_VERSION),)
ifneq ($(PKG_RELEASE),)
VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
5 changes: 5 additions & 0 deletions include/rootfs.mk
Original file line number Diff line number Diff line change
@@ -87,6 +87,11 @@ define prepare_rootfs
fi; \
done || true \
)
awk -i inplace \
'/^Status:/ { \
if ($$3 == "user") { $$3 = "ok" } \
else { sub(/,\<user\>|\<user\>,/, "", $$3) } \
}1' $(1)/usr/lib/opkg/status
$(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: $(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status)
@-find $(1) -name CVS -o -name .svn -o -name .git -o -name '.#*' | $(XARGS) rm -rf
rm -rf \
3 changes: 3 additions & 0 deletions include/subdir.mk
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@
ifeq ($(MAKECMDGOALS),prereq)
SUBTARGETS:=prereq
PREREQ_ONLY:=1
# For target/linux related target add dtb to selectively compile dtbs
else ifneq ($(filter target/linux/%,$(MAKECMDGOALS)),)
SUBTARGETS:=$(DEFAULT_SUBDIR_TARGETS) dtb
else
SUBTARGETS:=$(DEFAULT_SUBDIR_TARGETS)
endif
3 changes: 2 additions & 1 deletion include/toplevel.mk
Original file line number Diff line number Diff line change
@@ -77,7 +77,8 @@ _ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))

prepare-tmpinfo: FORCE
@+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK)
mkdir -p tmp/info
mkdir -p tmp/info feeds
[ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPTH=5 SCAN_EXTRA=""
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=3 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
for type in package target; do \
1 change: 1 addition & 0 deletions include/u-boot.mk
Original file line number Diff line number Diff line change
@@ -69,6 +69,7 @@ endef
TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))

UBOOT_MAKE_FLAGS = \
PATH=$(STAGING_DIR_HOST)/bin:$(PATH) \
HOSTCC="$(HOSTCC)" \
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \
HOSTLDFLAGS="$(HOST_LDFLAGS)" \
57 changes: 51 additions & 6 deletions package/base-files/files/etc/init.d/led
Original file line number Diff line number Diff line change
@@ -3,6 +3,39 @@

START=96

led_color_set() {
local cfg="$1"
local sysfs="$2"

local max_b
local colors
local color
local multi_intensity
local value
local write

[ -e /sys/class/leds/${sysfs}/multi_intensity ] || return
[ -e /sys/class/leds/${sysfs}/multi_index ] || return

max_b="$(cat /sys/class/leds/${sysfs}/max_brightness)"
colors="$(cat /sys/class/leds/${sysfs}/multi_index | tr " " "\n")"
multi_intensity=""
for color in $colors; do
config_get value $1 "color_${color}" "0"
[ "$value" -gt 0 ] && write=1
[ "$value" -gt "$max_b" ] && value="$max_b"
multi_intensity="${multi_intensity}${value} "
done

# Check if any color is configured
[ "$write" = 1 ] || return
# Remove last whitespace
multi_intensity="${multi_intensity:0:-1}"

echo "setting '${name}' led color to '${multi_intensity}'"
echo "${multi_intensity}" > /sys/class/leds/${sysfs}/multi_intensity
}

load_led() {
local name
local sysfs
@@ -49,21 +82,29 @@ load_led() {
[ -e /sys/class/leds/${sysfs}/brightness ] && {
echo "setting up led ${name}"

printf "%s %s %d\n" \
printf "%s %s %d" \
"$sysfs" \
"$(sed -ne 's/^.*\[\(.*\)\].*$/\1/p' /sys/class/leds/${sysfs}/trigger)" \
"$(cat /sys/class/leds/${sysfs}/brightness)" \
>> /var/run/led.state
# Save default color if supported
[ -e /sys/class/leds/${sysfs}/multi_intensity ] && {
printf " %s" \
"$(sed 's/\ /:/g' /sys/class/leds/${sysfs}/multi_intensity)" \
>> /var/run/led.state
}
printf "\n" >> /var/run/led.state

[ "$default" = 0 ] &&
echo 0 >/sys/class/leds/${sysfs}/brightness

echo $trigger > /sys/class/leds/${sysfs}/trigger 2> /dev/null
ret="$?"

[ $default = 1 ] &&
cat /sys/class/leds/${sysfs}/max_brightness > /sys/class/leds/${sysfs}/brightness

led_color_set "$1" "$sysfs"

echo $trigger > /sys/class/leds/${sysfs}/trigger 2> /dev/null
ret="$?"
[ $ret = 0 ] || {
echo >&2 "Skipping trigger '$trigger' for led '$name' due to missing kernel module"
return 1
@@ -128,13 +169,17 @@ load_led() {
start() {
[ -e /sys/class/leds/ ] && {
[ -s /var/run/led.state ] && {
local led trigger brightness
while read led trigger brightness; do
local led trigger brightness color
while read led trigger brightness color; do
[ -e "/sys/class/leds/$led/trigger" ] && \
echo "$trigger" > "/sys/class/leds/$led/trigger"

[ -e "/sys/class/leds/$led/brightness" ] && \
echo "$brightness" > "/sys/class/leds/$led/brightness"

[ -e "/sys/class/leds/$led/multi_intensity" ] && \
echo "$color" | sed 's/:/\ /g' > \
"/sys/class/leds/$led/multi_intensity"
done < /var/run/led.state
rm /var/run/led.state
}
11 changes: 11 additions & 0 deletions package/base-files/files/lib/functions/uci-defaults.sh
Original file line number Diff line number Diff line change
@@ -654,6 +654,17 @@ ucidef_set_ntpserver() {
json_select ..
}

ucidef_set_poe() {
json_select_object poe
json_add_string "budget" "$1"
json_select_array ports
for port in $2; do
json_add_string "" "$port"
done
json_select ..
json_select ..
}

ucidef_add_wlan() {
local path="$1"; shift

18 changes: 18 additions & 0 deletions package/base-files/files/lib/upgrade/common.sh
Original file line number Diff line number Diff line change
@@ -165,6 +165,23 @@ part_magic_fat() {
[ "$magic" = "FAT" ] || [ "$magic_fat32" = "FAT32" ]
}

fitblk_get_bootdev() {
[ -e /sys/firmware/devicetree/base/chosen/rootdisk ] || return

local rootdisk="$(cat /sys/firmware/devicetree/base/chosen/rootdisk)"
local handle bootdev
for handle in /sys/class/block/*/of_node/phandle /sys/class/block/*/device/of_node/phandle; do
[ ! -e "$handle" ] && continue
if [ "$rootdisk" = "$(cat $handle)" ]; then
bootdev="${handle%/of_node/phandle}"
bootdev="${bootdev%/device}"
bootdev="${bootdev#/sys/class/block/}"
echo "$bootdev"
break
fi
done
}

export_bootdevice() {
local cmdline uuid blockdev uevent line class
local MAJOR MINOR DEVNAME DEVTYPE
@@ -196,6 +213,7 @@ export_bootdevice() {
done
;;
/dev/*)
[ "$rootpart" = "/dev/fit0" ] && rootpart="$(fitblk_get_bootdev)"
uevent="/sys/class/block/${rootpart##*/}/../uevent"
;;
0x[a-f0-9][a-f0-9][a-f0-9] | 0x[a-f0-9][a-f0-9][a-f0-9][a-f0-9] | \
2 changes: 1 addition & 1 deletion package/base-files/files/lib/upgrade/nand.sh
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@ nand_remove_ubiblock() {

local ubiblk="ubiblock${ubivol:3}"
if [ -e "/dev/$ubiblk" ]; then
umount "/dev/$ubiblk" && echo "unmounted /dev/$ubiblk" || :
umount "/dev/$ubiblk" 2>/dev/null && echo "unmounted /dev/$ubiblk" || :
if ! ubiblock -r "/dev/$ubivol"; then
echo "cannot remove $ubiblk"
return 1
71 changes: 71 additions & 0 deletions package/base-files/files/lib/upgrade/tar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# SPDX-License-Identifier: GPL-2.0-or-later OR MIT

# Example usage:
#
# {
# tar_print_member "date.txt" "It's $(date +"%Y")"
# tar_print_trailer
# } > test.tar

__tar_print_padding() {
dd if=/dev/zero bs=1 count=$1 2>/dev/null
}

tar_print_member() {
local name="$1"
local content="$2"
local mtime="${3:-$(date +%s)}"
local mode=644
local uid=0
local gid=0
local size=${#content}
local type=0
local link=""
local username="root"
local groupname="root"

# 100 byte of padding bytes, using 0x01 since the shell does not tolerate null bytes in strings
local pad=$'\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1'

# validate name (strip leading slash if present)
name=${name#/}

# truncate string header values to their maximum length
name=${name:0:100}
link=${link:0:100}
username=${username:0:32}
groupname=${groupname:0:32}

# construct header part before checksum field
local header1="${name}${pad:0:$((100 - ${#name}))}"
header1="${header1}$(printf '%07d\1' $mode)"
header1="${header1}$(printf '%07o\1' $uid)"
header1="${header1}$(printf '%07o\1' $gid)"
header1="${header1}$(printf '%011o\1' $size)"
header1="${header1}$(printf '%011o\1' $mtime)"

# construct header part after checksum field
local header2="$(printf '%d' $type)"
header2="${header2}${link}${pad:0:$((100 - ${#link}))}"
header2="${header2}ustar ${pad:0:1}"
header2="${header2}${username}${pad:0:$((32 - ${#username}))}"
header2="${header2}${groupname}${pad:0:$((32 - ${#groupname}))}"

# calculate checksum over header fields
local checksum=0
for byte in $(printf '%s%8s%s' "$header1" "" "$header2" | tr '\1' '\0' | hexdump -ve '1/1 "%u "'); do
checksum=$((checksum + byte))
done

# print member header, padded to 512 byte
printf '%s%06o\0 %s' "$header1" $checksum "$header2" | tr '\1' '\0'
__tar_print_padding 183

# print content data, padded to multiple of 512 byte
printf "%s" "$content"
__tar_print_padding $((512 - (size % 512)))
}

tar_print_trailer() {
__tar_print_padding 1024
}
Loading
Oops, something went wrong.

0 comments on commit 3f1246e

Please sign in to comment.