Skip to content

Do not use sudo for running OS's scripts/enter.sh #2747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2025

Conversation

sairon
Copy link
Member

@sairon sairon commented Aug 6, 2025

Proposed change

Do not suggest to use sudo when running OS build - the container is started as privileged one and all the operations on host which needs sudo right are invoked with explicit sudo. If executed with sudo, configure now refuses to run because of a sanity check:

configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)

Also update output samples to mimic current Docker's output.

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features for which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Remove stale or deprecated documentation

Checklist

  • I have read and followed the documentation guidelines.
  • I have verified that my changes render correctly in the documentation.

Additional information

Summary by CodeRabbit

  • Documentation
    • Updated instructions to remove the use of sudo when running build scripts, providing clearer and more direct command examples for users. Output examples and prompts were adjusted to match the revised instructions.

Do not suggest to use `sudo` when running OS build - the container is
started as privileged one and all the operations on host which needs
sudo right are invoked with explicit `sudo`. If executed with sudo,
configure now refuses to run because of a sanity check:

configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)

Also update output samples to mimic current Docker's output.

Refs home-assistant/operating-system#4214
@sairon sairon requested a review from agners August 6, 2025 10:45
[...]
builder@c6dfb4cd4036:/build$
builder@d3d7577663c9:/build$
Copy link
Member Author

Choose a reason for hiding this comment

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

Just noticed this quite a pointless change as it's always random, I just blindly copied and cropped the output. But does no harm.

Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

📝 Walkthrough

Walkthrough

The documentation for getting started with the operating system was revised to remove the explicit use of sudo when running the scripts/enter.sh script. Example commands and output were updated to reflect this change, and references to Docker build logs were adjusted accordingly.

Changes

Cohort / File(s) Change Summary
Getting Started Docs Update
docs/operating-system/getting-started.md
Removed sudo from example invocations of scripts/enter.sh; updated command examples and output to match the new usage; adjusted references to Docker build logs and password prompts.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-os-getting-started-no-sudo

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
docs/operating-system/getting-started.md (5)

50-60: Add a language identifier for consistent code-block styling

Most other command snippets in this document use shell or bash for syntax highlighting.
Adding the same identifier here keeps the formatting consistent and aids readability.

-```
+```shell

52-53: Consider adding a short note clarifying the sudo password prompt

The example correctly shows that scripts/enter.sh is invoked without sudo, yet the next line still displays
[sudo] password for whoever:. Readers who skim may wonder why a sudo prompt appears immediately after a non-sudo command.

A parenthetical like “(the script invokes privileged commands internally, therefore sudo may still prompt for a password)” right after the prompt line would avoid confusion.
No technical change required—just an explanatory sentence.


82-84: Align language tag with earlier examples

For symmetry with earlier snippets, prepend a language identifier:

-```shell
+```shell
 scripts/enter.sh make O=output_rpi4_64 rpi4_64

90-96: Minor: remove redundant $ prompt marker or wrap in code block header

In the interactive example we already open the block with ```bash and include the $ prompt inside.
If you prefer to keep the prompt symbol, consider using `console` as the language tag to distinguish command from output.
Otherwise, stripping the leading `$` keeps copy-paste usability high.

Purely cosmetic—feel free to ignore if the team’s docs convention is to keep the $.


116-118: Nit: add language identifier to the OVA build snippet

Same consistency point as above:

-```bash
+```shell
 $ scripts/enter.sh make O=output_ova ova
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between bdcb14f and d4117ee.

📒 Files selected for processing (1)
  • docs/operating-system/getting-started.md (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - developers-home-assistant
  • GitHub Check: Header rules - developers-home-assistant
  • GitHub Check: Pages changed - developers-home-assistant

@frenck frenck merged commit 577e0dd into master Aug 7, 2025
5 checks passed
@frenck frenck deleted the fix-os-getting-started-no-sudo branch August 7, 2025 11:33
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