Skip to content

Conversation

@whfweb
Copy link

@whfweb whfweb commented Dec 8, 2025

📝 What does this PR do?

This PR adds a .gitattributes file to preserve execute permissions for init scripts, particularly for the ZeroTier init script at net/zerotier/files/etc/init.d/zerotier.

🔧 Why is this needed?

The ZeroTier init script currently lacks execute permissions in the Git repository, which causes the service to fail to start when building OpenWrt firmware from source.

📋 Changes:

  1. Added .gitattributes file with rules to:

    • Preserve execute permissions for all init.d scripts
    • Ensure proper line endings (LF) for shell scripts
    • Maintain correct file modes for ZeroTier and other services
  2. The specific rules ensure that:

    • net/zerotier/files/etc/init.d/zerotier retains execute permission
    • All shell scripts in the repository keep proper permissions

✅ Testing:

  • This change only adds metadata (.gitattributes) and does not affect code functionality
  • The .gitattributes file follows Git best practices
  • It helps ensure built firmware has correct permissions

📌 Notes:

  • This fix addresses issue: ZeroTier service fails to start due to missing execute permissions
  • Similar issues may affect other init scripts in the repository
  • The solution is non-invasive and follows Git standards

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc.
  • It is structured in a way that it is potentially upstreamable

@whfweb
Copy link
Author

whfweb commented Dec 8, 2025

抱歉,这个 PR 包含了误操作。我将关闭它并重新提交一个干净的版本。

Closing this PR due to unintended file deletions. Will submit a clean version.

@whfweb
Copy link
Author

whfweb commented Dec 8, 2025

解释删除和重新上传的原因:

  1. 删除旧的 zerotier 目录:因为原来的 init 脚本有问题(可能缺少 shebang 或权限)
  2. 上传新的 zerotier 文件:上传了修复后的版本
  3. 更新 zerotier:进一步优化
  4. 添加 .gitattributes:防止将来出现权限问题

具体修复了什么问题:

  • 原来的 net/zerotier/files/etc/init.d/zerotier 脚本缺少执行权限
  • 可能导致 OpenWrt 中 ZeroTier 服务无法启动
  • 现在确保脚本有正确的权限和 shebang

验证:

新的 init 脚本应该包含:

#!/bin/sh /etc/rc.common
# 和正确的启动逻辑

@whfweb
Copy link
Author

whfweb commented Dec 8, 2025

/close

@whfweb
Copy link
Author

whfweb commented Dec 8, 2025

@maintainers

Request to Close This PR

您好,我在提交此PR时包含了误操作(删除了net/zerotier目录)。虽然已重新上传文件并解释了原因,但为了保持提交历史的整洁,我希望能关闭此PR,并重新提交一个仅包含.gitattributes文件的干净版本。

我已在评论中尝试使用/close命令但未生效,麻烦您帮忙关闭此PR (#28027)。

谢谢!

@GeorgeSapkin
Copy link
Member

GeorgeSapkin commented Dec 8, 2025

Please use English for communication. You don't need to close and (potentially) re-open a PR with the same changes just because of the commit history as you can force-push to the same PR after you fix the commits. And please also check the contribution guidelines.

@GeorgeSapkin
Copy link
Member

You can rebase locally, drop unnecessary commits, unrelated to the PR, and then force-push.

@1715173329
Copy link
Member

This is clearly wrong. Git will keep attributes as-is.
The only way attributes get lost is that you manually replaced (delete + create) the file.

I'm not interested in maintaining such a top file for every package.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants