Skip to content

ci: mock sysctl in test container to avoid read-only filesystem errors#129

Draft
BKPepe wants to merge 1 commit into
openwrt:mainfrom
BKPepe:sysctl-read-only-fix
Draft

ci: mock sysctl in test container to avoid read-only filesystem errors#129
BKPepe wants to merge 1 commit into
openwrt:mainfrom
BKPepe:sysctl-read-only-fix

Conversation

@BKPepe

@BKPepe BKPepe commented Jul 1, 2026

Copy link
Copy Markdown
Member

When running container-based package tests (e.g. for transmission-daemon), packages or build scripts that try to write network settings or kernel parameters via sysctl or direct writes to /proc/sys fail because /proc/sys is mounted as read-only.

Hopefully fixes openwrt/packages#29355 (comment)

⚠️ I am going to test this first

When running container-based package tests (e.g. for transmission-daemon),
packages or build scripts that try to write network settings or kernel parameters
via sysctl or direct writes to /proc/sys fail because /proc/sys is mounted as read-only.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Comment on lines +14 to +20
cat << 'EOF' > /etc/init.d/sysctl
#!/bin/sh /etc/rc.common
START=11
start() { :; }
stop() { :; }
EOF
chmod +x /etc/init.d/sysctl

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not add this via the Dockerfile?

Otherwise, you can use tab suppression for readability:

Suggested change
cat << 'EOF' > /etc/init.d/sysctl
#!/bin/sh /etc/rc.common
START=11
start() { :; }
stop() { :; }
EOF
chmod +x /etc/init.d/sysctl
cat <<- 'EOF' > /etc/init.d/sysctl
#!/bin/sh /etc/rc.common
START=11
start() { :; }
stop() { :; }
EOF
chmod +x /etc/init.d/sysctl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants