Skip to content

init: fix FreeBSD build by guarding tmpfs mount with __linux__#666

Open
mtjhrc wants to merge 1 commit intocontainers:mainfrom
mtjhrc:fix-freebsd-init-build
Open

init: fix FreeBSD build by guarding tmpfs mount with __linux__#666
mtjhrc wants to merge 1 commit intocontainers:mainfrom
mtjhrc:fix-freebsd-init-build

Conversation

@mtjhrc
Copy link
Copy Markdown
Collaborator

@mtjhrc mtjhrc commented May 6, 2026

  • The tmpfs mount added in 536360a (init: Mount a tmpfs if requested) uses Linux-specific MS_NOEXEC/MS_NOSUID/MS_NODEV/MS_RELATIME flags and the Linux mount() signature, which don't exist on FreeBSD.
  • Guard the block with #if __linux__ to fix the FreeBSD cross-compilation that's currently breaking CI.

Fixes the init/init-freebsd build error:

init/init.c:1468:19: error: use of undeclared identifier 'MS_NOEXEC'
init/init.c:1468:31: error: use of undeclared identifier 'MS_NOSUID'
init/init.c:1468:43: error: use of undeclared identifier 'MS_NODEV'
init/init.c:1468:54: error: use of undeclared identifier 'MS_RELATIME'

The tmpfs mount added in 536360a uses Linux-specific MS_* flags and
the Linux mount() signature, which don't exist on FreeBSD. Guard the
block with #if __linux__ to fix the FreeBSD cross-compilation.

Signed-off-by: Matej Hrica <mhrica@redhat.com>
@mtjhrc mtjhrc force-pushed the fix-freebsd-init-build branch from 1ecf459 to 3c9682d Compare May 6, 2026 09:01
@lstocchi
Copy link
Copy Markdown
Contributor

lstocchi commented May 6, 2026

FWIW LGTM and thanks for the fix 🚀

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