Skip to content

Commit

Permalink
Merge branch 'bananapi4-new' into bananapi4
Browse files Browse the repository at this point in the history
Signed-off-by: Rudy Andram <[email protected]>
  • Loading branch information
rmandrad committed Oct 6, 2024
2 parents 3da290d + ac840d7 commit 54f1775
Show file tree
Hide file tree
Showing 137 changed files with 3,742 additions and 1,271 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"git.alwaysSignOff": true
}
4 changes: 2 additions & 2 deletions include/kernel-6.6
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-6.6 = .53
LINUX_KERNEL_HASH-6.6.53 = 285d181d1b252b0bf905f040d094215cf183ac98c31a17f9cce9f3537ef4d779
LINUX_VERSION-6.6 = .54
LINUX_KERNEL_HASH-6.6.54 = 5fae869d6a24055c16ffc2d92669e3fb2b258e34d36c850bb8cf9def417ecfa0
2 changes: 1 addition & 1 deletion include/kernel-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ define BuildKernel
download: $(if $(LINUX_SITE),$(DL_DIR)/$(LINUX_SOURCE))
prepare: $(STAMP_PREPARED)
compile: $(LINUX_DIR)/.modules
$(MAKE) -C image compile TARGET_BUILD=
+$(MAKE) -C image compile TARGET_BUILD=

dtb: $(STAMP_CONFIGURED)
$(_SINGLE)$(KERNEL_MAKE) scripts_dtc
Expand Down
5 changes: 5 additions & 0 deletions package/base-files/files/bin/config_generate
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,11 @@ generate_static_system() {
uci -q set "system.@system[-1].compat_version=1.0"
fi

local timezone
if json_get_var timezone timezone; then
uci -q set "system.@system[-1].timezone=$timezone"
fi

if json_is_a ntpserver array; then
local keys key
json_get_keys keys ntpserver
Expand Down
3 changes: 3 additions & 0 deletions package/base-files/files/etc/hotplug.d/leds/00-init
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

[ "$ACTION" = "add" ] && /etc/init.d/led start "$DEVICENAME"
3 changes: 2 additions & 1 deletion package/base-files/files/etc/init.d/boot
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ uci_apply_defaults() {
cd /etc/uci-defaults || return 0
files="$(ls)"
[ -z "$files" ] && return 0
mkdir -p /tmp/.uci
for file in $files; do
( . "./$(basename $file)" ) && rm -f "$file"
done
Expand Down Expand Up @@ -47,6 +46,8 @@ boot() {
sleep 1
}

mkdir -p /tmp/.uci
[ -f /etc/uci-defaults/30_uboot-envtools ] && (. /etc/uci-defaults/30_uboot-envtools)
/bin/config_generate
rm -f /tmp/.config_pending
/sbin/wifi config
Expand Down
7 changes: 5 additions & 2 deletions package/base-files/files/etc/init.d/led
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ load_led() {
config_get gpio $1 gpio "0"
config_get_bool inverted $1 inverted "0"

[ "$2" ] && [ "$sysfs" != "$2" ] && return

# execute application led trigger
[ -f "/usr/libexec/led-trigger/${trigger}" ] && {
. "/usr/libexec/led-trigger/${trigger}"
Expand Down Expand Up @@ -121,7 +123,7 @@ load_led() {
[ -e "/sys/class/leds/${sysfs}/$m" ] && \
echo 1 > /sys/class/leds/${sysfs}/$m
done
echo $interval > /sys/class/leds/${sysfs}/interval
echo $interval > /sys/class/leds/${sysfs}/interval 2>/dev/null
}
;;

Expand Down Expand Up @@ -171,6 +173,7 @@ start() {
[ -s /var/run/led.state ] && {
local led trigger brightness color
while read led trigger brightness color; do
[ "$1" ] && [ "$1" != "$led" ] && continue
[ -e "/sys/class/leds/$led/trigger" ] && \
echo "$trigger" > "/sys/class/leds/$led/trigger"

Expand All @@ -185,6 +188,6 @@ start() {
}

config_load system
config_foreach load_led led
config_foreach load_led led "$1"
}
}
3 changes: 2 additions & 1 deletion package/base-files/files/etc/sysctl.conf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Defaults are configured in /etc/sysctl.d/* and can be customized in this file
# User defined entries should be added to this file not to /etc/sysctl.d/* as
# that directory is not backed-up by default and will not survive a reimage
12 changes: 12 additions & 0 deletions package/base-files/files/etc/uci-defaults/50-root-passwd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
. /usr/share/libubox/jshn.sh

json_init
json_load "$(cat /etc/board.json)"

json_select credentials
json_get_vars root_password_hash root_password_hash
[ -z "$root_password_hash" ] || sed -i "s|^root:[^:]*|root:$root_password_hash|g" /etc/shadow

json_get_vars root_password_plain root_password_plain
[ -z "$root_password_plain" ] || { (echo "$root_password_plain"; sleep 1; echo "$root_password_plain") | passwd root }
json_select ..
86 changes: 86 additions & 0 deletions package/base-files/files/lib/functions/uci-defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,92 @@ ucidef_set_hostname() {
json_select ..
}

ucidef_set_timezone() {
local timezone="$1"
json_select_object system
json_add_string timezone "$timezone"
json_select ..
}

ucidef_set_wireless() {
local band="$1"
local ssid="$2"
local encryption="$3"
local key="$4"

case "$band" in
all|2g|5g|6g) ;;
*) return;;
esac
[ -z "$ssid" ] && return

json_select_object wlan
json_select_object defaults
json_select_object ssids
json_select_object "$band"
json_add_string ssid "$ssid"
[ -n "$encryption" ] && json_add_string encryption "$encryption"
[ -n "$key" ] && json_add_string key "$key"
json_select ..
json_select ..
json_select ..
json_select ..
}

ucidef_set_country() {
local country="$1"

json_select_object wlan
json_select_object defaults
json_add_string country "$country"
json_select ..
json_select ..
}

ucidef_set_wireless_mac_count() {
local band="$1"
local mac_count="$2"

case "$band" in
2g|5g|6g) ;;
*) return;;
esac
[ -z "$mac_count" ] && return

json_select_object wlan
json_select_object defaults
json_select_object ssids
json_select_object "$band"
json_add_string mac_count "$mac_count"
json_select ..
json_select ..
json_select ..
json_select ..
}

ucidef_set_root_password_plain() {
local passwd="$1"
json_select_object credentials
json_add_string root_password_plain "$passwd"
json_select ..
}

ucidef_set_root_password_hash() {
local passwd="$1"
json_select_object credentials
json_add_string root_password_hash "$passwd"
json_select ..
}

ucidef_set_ssh_authorized_key() {
local ssh_key="$1"
json_select_object credentials
json_select_array ssh_authorized_keys
json_add_string "" "$ssh_key"
json_select ..
json_select ..
}

ucidef_set_ntpserver() {
local server

Expand Down
3 changes: 3 additions & 0 deletions package/boot/uboot-envtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ define Package/uboot-envtools/install
$(LN) fw_printenv $(1)/usr/sbin/fw_setenv
$(INSTALL_BIN) ./files/fw_printsys $(1)/usr/sbin
$(INSTALL_BIN) ./files/fw_setsys $(1)/usr/sbin
$(INSTALL_BIN) ./files/fw_loadenv $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/board.d
$(INSTALL_DATA) ./files/fw_defaults $(1)/etc/board.d/05_fw_defaults
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
$(INSTALL_DIR) $(1)/etc/uci-defaults
Expand Down
17 changes: 17 additions & 0 deletions package/boot/uboot-envtools/files/fw_defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
. /lib/functions/uci-defaults.sh

fw_loadenv

board_config_update

[ -f /var/run/uboot-env/owrt_ssid -a -f /var/run/uboot-env/owrt_wifi_key ] &&
ucidef_set_wireless all "$(cat /var/run/uboot-env/owrt_ssid)" sae-mixed "$(cat /var/run/uboot-env/owrt_wifi_key)"
[ -f /var/run/uboot-env/owrt_country ] && ucidef_set_country "$(cat /var/run/uboot-env/owrt_country)"
[ -f /var/run/uboot-env/owrt_ssh_auth_key ] && ucidef_set_ssh_authorized_key "$(cat /var/run/uboot-env/owrt_ssh_auth_key)"
[ -f /var/run/uboot-env/owrt_root_password_plain ] && ucidef_set_root_password_plain "$(cat /var/run/uboot-env/owrt_root_password_plain)"
[ -f /var/run/uboot-env/owrt_root_password_hash ] && ucidef_set_root_password_hash "$(cat /var/run/uboot-env/owrt_root_password_hash)"
[ -f /var/run/uboot-env/owrt_timezone ] && ucidef_set_timezone "$(cat /var/run/uboot-env/owrt_timezone)"

board_config_flush

exit 0
26 changes: 26 additions & 0 deletions package/boot/uboot-envtools/files/fw_loadenv
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/ucode

'use strict';

const path = '/var/run/uboot-env/';

import * as fs from 'fs';

if (fs.lsdir(path)) {
warn(`env has already been loaded to ${path}\n`);
exit(0);
}

let fp = fs.popen('fw_printenv');
let raw = fp.read('all');
fp.close();

if (!length(raw))
exit(0);

fs.mkdir(path);
for (let line in split(raw, '\n')) {
let vals = split(line, '=');
if (vals[0] && vals[1])
fs.writefile(path + vals[0], vals[1]);
}
4 changes: 2 additions & 2 deletions package/devel/strace/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=strace
PKG_VERSION:=6.7
PKG_VERSION:=6.11
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION)
PKG_HASH:=2090201e1a3ff32846f4fe421c1163b15f440bb38e31355d09f82d3949922af7
PKG_HASH:=83262583a3529f02c3501aa8b8ac772b4cbc03dc934e98bab6e4883626e283a5

PKG_MAINTAINER:=Felix Fietkau <[email protected]>
PKG_LICENSE:=LGPL-2.1-or-later
Expand Down
4 changes: 2 additions & 2 deletions package/devel/valgrind/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=valgrind
PKG_VERSION:=3.22.0
PKG_VERSION:=3.23.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://sourceware.org/pub/valgrind/
PKG_HASH:=c811db5add2c5f729944caf47c4e7a65dcaabb9461e472b578765dd7bf6d2d4c
PKG_HASH:=c5c34a3380457b9b75606df890102e7df2c702b9420c2ebef9540f8b5d56264d

PKG_MAINTAINER:=Felix Fietkau <[email protected]>
PKG_LICENSE:=GPL-2.0+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
From 7214886886bce9029f325214156c02dcfff760d5 Mon Sep 17 00:00:00 2001
From: Paul Floyd <[email protected]>
Date: Sat, 27 Apr 2024 13:07:07 +0200
Subject: 486180 - [Valgrind][MIPS] 'VexGuestArchState' has no member named
'guest_IP_AT_SYSCALL'

---
NEWS | 34 ++++++++++++++++++++++++++++++++++
VEX/priv/guest_mips_helpers.c | 4 ++++
VEX/pub/libvex_guest_mips32.h | 6 +++---
VEX/pub/libvex_guest_mips64.h | 2 ++
configure.ac | 6 +++---
5 files changed, 46 insertions(+), 6 deletions(-)

--- a/VEX/priv/guest_mips_helpers.c
+++ b/VEX/priv/guest_mips_helpers.c
@@ -187,6 +187,8 @@ void LibVEX_GuestMIPS32_initialise( /*OU
vex_state->guest_w1.w64[1] = 0;
vex_state->guest_w2.w64[0] = 0;
vex_state->guest_w2.w64[1] = 0;
+
+ vex_state->guest_IP_AT_SYSCALL = 0;
}

void LibVEX_GuestMIPS64_initialise ( /*OUT*/ VexGuestMIPS64State * vex_state )
@@ -294,6 +296,8 @@ void LibVEX_GuestMIPS64_initialise ( /*O
vex_state->guest_LLaddr = 0xFFFFFFFFFFFFFFFFULL;
vex_state->guest_LLdata = 0;

+ vex_state->guest_IP_AT_SYSCALL = 0;
+
vex_state->guest_MSACSR = 0;
}

--- a/VEX/pub/libvex_guest_mips32.h
+++ b/VEX/pub/libvex_guest_mips32.h
@@ -188,10 +188,10 @@ typedef

/* 1016 */ UInt guest_MSACSR;

- /* 1020 */ UInt _padding3;
+ /* 1020 */ UInt guest_IP_AT_SYSCALL;

- /* 1020 */ ULong guest_LLdata64;
- /* 1028 */ ULong _padding4;
+ /* 1024 */ ULong guest_LLdata64;
+ /* 1032 */ ULong _padding3;
} VexGuestMIPS32State;
/*---------------------------------------------------------------*/
/*--- Utility functions for MIPS32 guest stuff. ---*/
--- a/VEX/pub/libvex_guest_mips64.h
+++ b/VEX/pub/libvex_guest_mips64.h
@@ -184,6 +184,8 @@ typedef
/* 1144 */ UInt guest_MSACSR;

/* 1148 */ UInt _padding2;
+ /* 1152 */ ULong guest_IP_AT_SYSCALL;
+ /* 1160 */ ULong _padding3;

} VexGuestMIPS64State;

Loading

0 comments on commit 54f1775

Please sign in to comment.