Compare commits

...

8 Commits

Author SHA1 Message Date
c4178b7ec7 Merge pull request 'fix for HA' (#1) from ha-osbuilder into dev
Reviewed-on: #1
2023-03-28 22:16:58 +02:00
b15ed586ae fix for HA 2023-03-28 22:03:48 +02:00
Stefan Agner
399997e83c Set umask on swapfile creation (#2436)
Make sure the swapfile is only readable by the owner.
2023-03-28 18:18:58 +02:00
Stefan Agner
1edb5c8c9e Limit systemd-journald log size to 500MB (#2226) (#2435) 2023-03-28 18:18:27 +02:00
Stefan Agner
c64c5b13ab Improve IPv6 NDP for non-local Thread Border routers (#2434)
* Add multiple routes support in NetworkManager

Support multiple routes to the same network learned via Router
Information Option. With this change, the kernel will have multiple
routing table entries to a given Thread network. The routes gateway
won't be updated with every new RIO any longer since every gateway
has its own entry.

* Enable IPv6 router reachability probing

Currently router reachability probing is disabled since HAOS enables
IPv6 forwarding and the necessary kernel options are not enabled. With
this change router reachability probing is enabled even though we are
a router on our own.

Note that Linux commit ea659e077528 ("[IPV6] ROUTE: Do not enable router
reachability probing in router mode.") by default disabled this
behavior. But since we are acting as a router as well as a host device,
we rather want this reachability probing.

See also: https://lore.kernel.org/netdev/b9182b02829b158d55acc53a0bcec1ed667b2668.1680000784.git.stefan@agner.ch/T/#u
2023-03-28 18:18:19 +02:00
Jens Maus
555c229519 updated generic_raw_uart to latest 1.28 version and updated rpi-rf-mod (#2431)
package to latest version as well.
2023-03-27 09:35:22 +02:00
Stefan Agner
4744a2f123 Fix swapfile creation for all memory sizes (#2427)
* Fix swapfile creation for all memory sizes

In certain situation awk prints the swapfile size in scientific
notation. The script can't deal with that, in which case swap file
creation fails.

Use int to convert the number to an integer.

Since pages are 4k, also make sure swapsize is aligned to 4k blocks.

* Add info message
2023-03-27 09:34:38 +02:00
Stefan Agner
9cd98003e8 Bump OS release version to 11 2023-03-25 09:19:26 +01:00
11 changed files with 100 additions and 15 deletions

View File

@@ -60,6 +60,8 @@ CONFIG_BT_HIDP=m
CONFIG_BT_LEDS=y
CONFIG_IPV6=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_REACHABILITY_PROBE=y
CONFIG_IPV6_SIT=m
CONFIG_IP_MROUTE=y

View File

@@ -1,4 +1,4 @@
VERSION_MAJOR=10
VERSION_MAJOR=11
VERSION_BUILD=0
HASSOS_NAME="Home Assistant OS"

View File

@@ -1,3 +1,3 @@
# Locally computed
sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1 LICENSE
sha256 07a0de82e6bf25d35df3520beaea886644160bac4077c3ccb9bb615f5d266972 generic_raw_uart-b787f3d84b311bd3e07b0ca8f2aa63330030746e.tar.gz
sha256 bea4b61fb1ca9f85ed080344709f48c0fd8ab8950cd370506d822b14d287744e generic_raw_uart-610c9cf1e6b84720b638e12ffc192dbc150aed84.tar.gz

View File

@@ -13,15 +13,11 @@
#
################################################################################
GENERIC_RAW_UART_VERSION = b787f3d84b311bd3e07b0ca8f2aa63330030746e
GENERIC_RAW_UART_VERSION = 610c9cf1e6b84720b638e12ffc192dbc150aed84
GENERIC_RAW_UART_SITE = $(call github,alexreinert,piVCCU,$(GENERIC_RAW_UART_VERSION))
GENERIC_RAW_UART_LICENSE = GPL2
GENERIC_RAW_UART_LICENSE_FILES = LICENSE
GENERIC_RAW_UART_MODULE_SUBDIRS = kernel
define GENERIC_RAW_UART_LINUX_CONFIG_FIXUPS
$(call KCONFIG_DISABLE_OPT,CONFIG_WERROR)
endef
$(eval $(kernel-module))
$(eval $(generic-package))

View File

@@ -1,2 +1,2 @@
sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1 LICENSE
sha256 df22bcebb72f1ce7dc01504e2a1d097dd09fed20a461b36c2dd273f6ba7f8c96 rpi-rf-mod-de15b40fe87116c14c810b25d3b5107091e8946b.tar.gz
sha256 92e90678e7305486625777322c576a0a5a124a9199b5515e65ae72cbdb1ca534 rpi-rf-mod-b472ab34508e8de6ad152ba81b0059fab3e77d38.tar.gz

View File

@@ -14,7 +14,7 @@
#
################################################################################
RPI_RF_MOD_VERSION = de15b40fe87116c14c810b25d3b5107091e8946b
RPI_RF_MOD_VERSION = b472ab34508e8de6ad152ba81b0059fab3e77d38
RPI_RF_MOD_SITE = $(call github,jens-maus,RaspberryMatic,$(RPI_RF_MOD_VERSION))
RPI_RF_MOD_LICENSE = Apache-2.0
RPI_RF_MOD_DEPENDENCIES = host-dtc

View File

@@ -0,0 +1,56 @@
From b9182b02829b158d55acc53a0bcec1ed667b2668 Mon Sep 17 00:00:00 2001
Message-Id: <b9182b02829b158d55acc53a0bcec1ed667b2668.1680000784.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Tue, 28 Mar 2023 12:02:10 +0200
Subject: [PATCH] ipv6: add option to explicitly enable reachability test
Systems which act as host as well as router might prefer the host
behavior. Currently the kernel does not allow to use IPv6 forwarding
globally and at the same time use route reachability probing.
Add a compile time flag to enable route reachability probe in any
case.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
net/ipv6/Kconfig | 9 +++++++++
net/ipv6/route.c | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
index 658bfed1df8b..5147fd4c93ff 100644
--- a/net/ipv6/Kconfig
+++ b/net/ipv6/Kconfig
@@ -48,6 +48,15 @@ config IPV6_OPTIMISTIC_DAD
If unsure, say N.
+config IPV6_REACHABILITY_PROBE
+ bool "IPv6: Always use reachability probing (RFC 4191)"
+ help
+ By default reachability probing is disabled on router devices (when
+ IPv6 forwarding is enabled). This option explicitly enables
+ reachability probing always.
+
+ If unsure, say N.
+
config INET6_AH
tristate "IPv6: AH transformation"
select XFRM_AH
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 0fdb03df2287..5e1e1f02f400 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2210,7 +2210,8 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
strict |= flags & RT6_LOOKUP_F_IFACE;
strict |= flags & RT6_LOOKUP_F_IGNORE_LINKSTATE;
- if (net->ipv6.devconf_all->forwarding == 0)
+ if (net->ipv6.devconf_all->forwarding == 0 ||
+ IS_ENABLED(IPV6_REACHABILITY_PROBE))
strict |= RT6_LOOKUP_F_REACHABLE;
rcu_read_lock();
--
2.40.0

View File

@@ -0,0 +1,27 @@
From a053500cf43a31ee82a6e0f3d644ea36f5c77ffb Mon Sep 17 00:00:00 2001
Message-Id: <a053500cf43a31ee82a6e0f3d644ea36f5c77ffb.1679932288.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Mon, 27 Mar 2023 17:48:34 +0200
Subject: [PATCH] ndisc: support multiple gateways for a single network
---
src/core/ndisc/nm-ndisc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/core/ndisc/nm-ndisc.c b/src/core/ndisc/nm-ndisc.c
index 9a6038d406..67cdf5d99a 100644
--- a/src/core/ndisc/nm-ndisc.c
+++ b/src/core/ndisc/nm-ndisc.c
@@ -654,7 +654,8 @@ nm_ndisc_add_route(NMNDisc *ndisc, const NMNDiscRoute *new_item, gint64 now_msec
NMNDiscRoute *item = &g_array_index(rdata->routes, NMNDiscRoute, i);
if (IN6_ARE_ADDR_EQUAL(&item->network, &new_item->network)
- && item->plen == new_item->plen) {
+ && item->plen == new_item->plen
+ && IN6_ARE_ADDR_EQUAL(&item->gateway, &new_item->gateway)) {
if (new_item->expiry_msec <= now_msec) {
g_array_remove_index(rdata->routes, i);
return TRUE;
--
2.40.0

View File

@@ -1,3 +1,4 @@
[Journal]
Storage=auto
Compress=yes
SystemMaxUse=500M

View File

@@ -2,17 +2,20 @@
set -e
swapfile="/mnt/data/swapfile"
swapsize="$(awk '/MemTotal/{ print $2 * 0.33 }' /proc/meminfo)"
# Swap space in 4k blocks
swapsize="$(awk '/MemTotal/{ print int($2 * 0.33 / 4) }' /proc/meminfo)"
if [ ! -s "${swapfile}" ] || [ "$(stat "${swapfile}" -c '%s')" -lt $((swapsize * 1024)) ]; then
if [ ! -s "${swapfile}" ] || [ "$(stat "${swapfile}" -c '%s')" -lt $((swapsize * 4096)) ]; then
# Check free space (in 4k blocks)
if [ "$(stat -f /mnt/data -c '%f')" -lt $((swapsize / 4)) ]; then
if [ "$(stat -f /mnt/data -c '%f')" -lt "${swapsize}" ]; then
echo "[WARNING] Not enough space to allocate swapfile"
exit 1
fi
dd if=/dev/zero of="${swapfile}" bs=1k count="${swapsize}"
echo "[INFO] Creating swapfile of size $((swapsize *4))k"
umask 0077
dd if=/dev/zero of="${swapfile}" bs=4k count="${swapsize}"
fi
if ! swaplabel "${swapfile}" > /dev/null 2>&1; then

View File

@@ -3,7 +3,7 @@ set -e
BUILDER_UID="$(id -u)"
BUILDER_GID="$(id -g)"
CACHE_DIR="${CACHE_DIR:-$HOME/hassos-cache}"
CACHE_DIR="/mnt/data/supervisor/$(pwd)/hassos-cache}"
ARGS="$*"
COMMAND="${ARGS:-bash}"
@@ -21,6 +21,6 @@ sudo losetup -f > /dev/null
# shellcheck disable=SC2086
sudo docker run -it --rm --privileged \
-v "$(pwd):/build" -v "${CACHE_DIR}:/cache" \
-v "/mnt/data/supervisor/$(pwd):/build" -v "${CACHE_DIR}:/cache" \
-e BUILDER_UID="${BUILDER_UID}" -e BUILDER_GID="${BUILDER_GID}" \
hassos:local ${COMMAND}