Skip to content

Commit

Permalink
Merge branch 'openwrt:main' into fix/sbom_missing_type_for_kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
sah-cdo authored Mar 1, 2024
2 parents 429ee6f + a86ff06 commit d4dd399
Show file tree
Hide file tree
Showing 3,217 changed files with 194,035 additions and 79,627 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
55 changes: 1 addition & 54 deletions .github/workflows/formal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,4 @@ permissions:
jobs:
build:
name: Test Formalities
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Determine branch name
run: |
BRANCH="${GITHUB_BASE_REF#refs/heads/}"
echo "Building for $BRANCH"
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
- name: Test formalities
run: |
source .github/workflows/scripts/ci_helpers.sh
RET=0
for commit in $(git rev-list HEAD ^origin/$BRANCH); do
info "=== Checking commit '$commit'"
if git show --format='%P' -s $commit | grep -qF ' '; then
err "Pull request should not include merge commits"
RET=1
fi
subject="$(git show -s --format=%s $commit)"
if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_\.-]\+: ' -e '^Revert '; then
success "Commit subject line seems ok ($subject)"
else
err "Commit subject line MUST start with '<area>: ' ($subject)"
RET=1
fi
body="$(git show -s --format=%b $commit)"
sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)"
if echo "$body" | grep -qF "$sob"; then
success "Signed-off-by match author"
else
err "Signed-off-by is missing or doesn't match author (should be '$sob')"
RET=1
fi
if echo "$body" | grep -v "Signed-off-by:"; then
success "A commit message exists"
else
err "Missing commit message. Please describe your changes"
RET=1
fi
done
exit $RET
uses: openwrt/actions-shared-workflows/.github/workflows/formal.yml@main
2 changes: 2 additions & 0 deletions config/Config-build.in
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ menu "Global build settings"
bool "Regular"
config PKG_CC_STACKPROTECTOR_STRONG
bool "Strong"
config PKG_CC_STACKPROTECTOR_ALL
bool "All"
endchoice

choice
Expand Down
15 changes: 0 additions & 15 deletions config/Config-kernel.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions include/hardening.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ ifdef CONFIG_PKG_CC_STACKPROTECTOR_STRONG
TARGET_CFLAGS += -fstack-protector-strong
endif
endif
ifdef CONFIG_PKG_CC_STACKPROTECTOR_ALL
ifeq ($(strip $(PKG_SSP)),1)
TARGET_CFLAGS += -fstack-protector-all
endif
endif
ifdef CONFIG_PKG_FORTIFY_SOURCE_1
ifeq ($(strip $(PKG_FORTIFY_SOURCE)),1)
TARGET_CFLAGS += -D_FORTIFY_SOURCE=1
Expand Down
14 changes: 14 additions & 0 deletions include/image-commands.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
10 changes: 6 additions & 4 deletions include/image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down
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 = .146
LINUX_KERNEL_HASH-5.15.146 = 5a807a5fa2a80ada957d8079681dfb5cc196ec26f43244d1c8a4fd7af592d192
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 = .71
LINUX_KERNEL_HASH-6.1.71 = 2df774dd53f9ffd4e57ebf804cf597709295df6a304fe261d25220a134b7f041
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
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion include/package-defaults.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions include/rootfs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 3 additions & 0 deletions include/subdir.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion include/toplevel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
57 changes: 51 additions & 6 deletions package/base-files/files/etc/init.d/led
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion package/base-files/files/lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ prepend() {
local value="$2"
local sep="${3:- }"

eval "export ${NO_EXPORT:+-n} -- \"$var=\${$value:+\${$value}\$sep}\$var\""
eval "export ${NO_EXPORT:+-n} -- \"$var=\$value\${$var:+\${sep}\${$var}}\""
}

list_contains() {
Expand Down
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
Expand Up @@ -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

Expand Down
21 changes: 20 additions & 1 deletion package/base-files/files/lib/preinit/80_mount_root
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,27 @@ missing_lines() {
IFS="$oIFS"
}

# Rootfs mount options can be passed by declaring in the kernel
# cmdline as much options as needed prefixed with "rootfs_mount_options."
#
# Example:
# rootfs_mount_options.compress_algorithm=zstd rootfs_mount_options.noinline_data
#
compose_rootfs_mount_options() {
local mount_options
local cmdlinevar

for cmdlinevar in $(cat /proc/cmdline); do
if [ "$cmdlinevar" != "${cmdlinevar#rootfs_mount_options\.}" ]; then
append mount_options "${cmdlinevar#rootfs_mount_options\.}"
fi
done

echo $mount_options
}

do_mount_root() {
mount_root
mount_root start "$(compose_rootfs_mount_options)"
boot_run_hook preinit_mount_root
[ -f /sysupgrade.tgz -o -f /tmp/sysupgrade.tar ] && {
echo "- config restore -"
Expand Down
Loading

0 comments on commit d4dd399

Please sign in to comment.