From d1b16d204ffbd4f3c3657820d3f06ee17741c834 Mon Sep 17 00:00:00 2001 From: Tommaso Bailetti Date: Wed, 27 May 2026 09:11:06 +0200 Subject: [PATCH 1/3] build: updated profile directory, hushed apk-cheatsheet --- .../uci-defaults/99-nethsec-update-profile | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 files/etc/uci-defaults/99-nethsec-update-profile diff --git a/files/etc/uci-defaults/99-nethsec-update-profile b/files/etc/uci-defaults/99-nethsec-update-profile new file mode 100644 index 000000000..ef057bfb3 --- /dev/null +++ b/files/etc/uci-defaults/99-nethsec-update-profile @@ -0,0 +1,21 @@ +# +# Copyright (C) 2026 Nethesis S.r.l. +# SPDX-License-Identifier: GPL-2.0-only +# + +# Since OpenWRT sets profile directory and file as config files, they are not replaced upon update. +# This script is used to copy the profile and profile.d files from the rom to the etc directory, then hush the + +if [ -f /rom/etc/profile ]; then + cp /rom/etc/profile /etc/profile +fi + +for file in /rom/etc/profile.d; do + if [ -f "$file" ]; then + cp "$file" /etc/profile.d/ + fi +done + +# hush the /etc/profile.d/apk-cheatsheet.sh + +touch /etc/profile.d/apk-cheatsheet.hush From 7e261822d525a0a0bd188b0c290996267a4503d7 Mon Sep 17 00:00:00 2001 From: Giacomo Sanchietti Date: Wed, 27 May 2026 11:35:50 +0200 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Giacomo Sanchietti --- files/etc/uci-defaults/99-nethsec-update-profile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/etc/uci-defaults/99-nethsec-update-profile b/files/etc/uci-defaults/99-nethsec-update-profile index ef057bfb3..a621296c6 100644 --- a/files/etc/uci-defaults/99-nethsec-update-profile +++ b/files/etc/uci-defaults/99-nethsec-update-profile @@ -4,7 +4,7 @@ # # Since OpenWRT sets profile directory and file as config files, they are not replaced upon update. -# This script is used to copy the profile and profile.d files from the rom to the etc directory, then hush the +# This script is used to copy the profile and profile.d files from the rom to the etc directory, then hush the /etc/profile.d/apk-cheatsheet.sh if [ -f /rom/etc/profile ]; then cp /rom/etc/profile /etc/profile @@ -16,6 +16,5 @@ for file in /rom/etc/profile.d; do fi done -# hush the /etc/profile.d/apk-cheatsheet.sh touch /etc/profile.d/apk-cheatsheet.hush From 4b084c6e76d87f242bd0e26ef8dcfefbf721add7 Mon Sep 17 00:00:00 2001 From: Tommaso Bailetti Date: Wed, 27 May 2026 11:53:25 +0200 Subject: [PATCH 3/3] fixes after internal discussion --- files/etc/uci-defaults/99-nethsec-update-profile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/files/etc/uci-defaults/99-nethsec-update-profile b/files/etc/uci-defaults/99-nethsec-update-profile index a621296c6..8c2356102 100644 --- a/files/etc/uci-defaults/99-nethsec-update-profile +++ b/files/etc/uci-defaults/99-nethsec-update-profile @@ -4,17 +4,10 @@ # # Since OpenWRT sets profile directory and file as config files, they are not replaced upon update. -# This script is used to copy the profile and profile.d files from the rom to the etc directory, then hush the /etc/profile.d/apk-cheatsheet.sh +# This script updates the /rom/etc/profile, then hush the /etc/profile.d/apk-cheatsheet.sh if [ -f /rom/etc/profile ]; then cp /rom/etc/profile /etc/profile fi -for file in /rom/etc/profile.d; do - if [ -f "$file" ]; then - cp "$file" /etc/profile.d/ - fi -done - - touch /etc/profile.d/apk-cheatsheet.hush