Skip to content

Commit

Permalink
Fix kernel configuration access for Debian Supervised installations (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lmagyar authored Feb 2, 2024
1 parent e73720d commit a5deefa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tailscale/rootfs/etc/s6-overlay/s6-rc.d/mss-clamping/run
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (( 0 < ${#routes[@]} )); then
bashio::log.info "Clamping the MSS to the MTU for all advertised subnet's interface,"
bashio::log.info "to support site-to-site networking better"

if (( 0 == $(zcat /proc/config.gz | { grep -Ec '^CONFIG_NETFILTER_XT_TARGET_TCPMSS=.$' || true ;}) )); then
if (( 0 == $(kernel-config | { grep -Ec '^CONFIG_NETFILTER_XT_TARGET_TCPMSS=.$' || true ;}) )); then
bashio::log.warning "Altering the MSS is not supported due to missing kernel module,"
bashio::log.warning "skip clamping the MSS to the MTU for all advertised subnet's interface"
else
Expand Down
7 changes: 7 additions & 0 deletions tailscale/rootfs/usr/bin/kernel-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/command/with-contenv bashio

if bashio::fs.file_exists /proc/config.gz; then
zcat /proc/config.gz
else
cat /boot/config-$(uname -r)
fi
4 changes: 2 additions & 2 deletions tailscale/rootfs/usr/bin/protect-subnet-routes
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ declare response
declare wait_counter=0

if bashio::config.false "userspace_networking"; then
ipv4_multiple_tables_enabled=$(zcat /proc/config.gz | { grep -Ec '^CONFIG_IP_MULTIPLE_TABLES=y$' || true ;})
ipv6_multiple_tables_enabled=$(zcat /proc/config.gz | { grep -Ec '^CONFIG_IPV6_MULTIPLE_TABLES=y$' || true ;})
ipv4_multiple_tables_enabled=$(kernel-config | { grep -Ec '^CONFIG_IP_MULTIPLE_TABLES=y$' || true ;})
ipv6_multiple_tables_enabled=$(kernel-config | { grep -Ec '^CONFIG_IPV6_MULTIPLE_TABLES=y$' || true ;})

# If it is called after network configuration is changed, we need to drop cached network info
bashio::cache.flush_all
Expand Down

0 comments on commit a5deefa

Please sign in to comment.