发布 chromeos-fix-captive-portal#105
Merged
Merged
Conversation
Contributor
Reviewer's GuideAdds a new blog post documenting how to patch ChromeOS’s shill binary to fix captive portal connectivity checks, including an embedded Bash script and associated screenshots/thumbnail assets. Flow diagram for patch_shill.sh captive portal patch processflowchart TD
A[start patch_shill.sh] --> B{arg -r ?}
B -- yes --> R1[check backup exists]
R1 --> R2[stop_shill]
R2 --> R3[restore backup to shill]
R3 --> R4[apply_selinux_context]
R4 --> R5[restart_shill]
R5 --> Z[exit]
B -- no --> C[detect shill path]
C --> C1[stop_shill]
C1 --> D{backup exists ?}
D -- no --> D1[create backup]
D -- yes --> D2[skip backup]
D1 --> E[ensure_backup_context]
D2 --> E
E --> F[record orig_size]
F --> G[replace_url for all hardcoded generate_204 endpoints]
G --> H[record new_size]
H --> I{orig_size == new_size ?}
I -- no --> J[rollback_to_backup file size changed]
J --> Z
I -- yes --> K[verify replacements with pairs list]
K --> L{verify_ok == 1 ?}
L -- yes --> M[print patch ok]
M --> N[restart_shill]
N --> Z
L -- no --> P[rollback_to_backup verify failed]
P --> Z
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
✅ 构建检查完全通过!
|
Contributor
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- The patch script hardcodes the replacement endpoints (google.cn, dl.google.com); consider moving these into clearly grouped variables or a small config section at the top of the script so users can easily change them for different regions or custom endpoints without editing the core logic.
- Before operating on /usr/bin/shill, you might want to add a simple platform/variant sanity check (e.g., verifying ChromeOS-specific files or shill version/strings) to avoid accidental use on non-target systems or incompatible ChromeOS builds.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The patch script hardcodes the replacement endpoints (google.cn, dl.google.com); consider moving these into clearly grouped variables or a small config section at the top of the script so users can easily change them for different regions or custom endpoints without editing the core logic.
- Before operating on /usr/bin/shill, you might want to add a simple platform/variant sanity check (e.g., verifying ChromeOS-specific files or shill version/strings) to avoid accidental use on non-target systems or incompatible ChromeOS builds.
## Individual Comments
### Comment 1
<location path="source/_posts/chromeos-fix-captive-portal.md" line_range="17" />
<code_context>
+
+一年前多前新入了一个AMD笔记本,算是把老Intel电脑换掉了,而且由于CPU受支持,终于可以装上心心念念的[brunch ChromeOS](https://github.com/sebanc/brunch)。
+
+关于怎么安装这里不必多赘述,它自带的文档写的还挺清楚。需注意如果要保留安全启动的话,最好是linux安装然后禁用mokutil的shim额外验证。
+
+安装完成之后手机上网开[热点](https://github.com/Mygod/VPNHotspot),网上教程多这里不再讲了。
</code_context>
<issue_to_address>
**issue (typo):** “写的还挺清楚”按规范应为“写得还挺清楚”。
这里的“得”作程度补语,按现代汉语规范一般不用“的”。建议改为「文档写得还挺清楚」。
```suggestion
关于怎么安装这里不必多赘述,它自带的文档写得还挺清楚。需注意如果要保留安全启动的话,最好是linux安装然后禁用mokutil的shim额外验证。
```
</issue_to_address>
### Comment 2
<location path="source/_posts/chromeos-fix-captive-portal.md" line_range="391-392" />
<code_context>
+## 小结
+
+ChromeOS 和 Chromebook 似乎又要成为 Google 的弃子了,哎
+新的 Googlebook 能走多远呢?
+
+本文撰写自 ChromeOS 148。
</code_context>
<issue_to_address>
**question (typo):** 确认一下“Googlebook”是否为刻意使用的说法。
前面一直用的是“Chromebook”,这里突然出现“Googlebook”。如果不是刻意的调侃或用法,建议统一改回“Chromebook”,以免被误以为是正式产品名称。
```suggestion
ChromeOS 和 Chromebook 似乎又要成为 Google 的弃子了,哎
新的 Chromebook 能走多远呢?
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Comment on lines
+391
to
+392
| ChromeOS 和 Chromebook 似乎又要成为 Google 的弃子了,哎 | ||
| 新的 Googlebook 能走多远呢? |
Contributor
There was a problem hiding this comment.
question (typo): 确认一下“Googlebook”是否为刻意使用的说法。
前面一直用的是“Chromebook”,这里突然出现“Googlebook”。如果不是刻意的调侃或用法,建议统一改回“Chromebook”,以免被误以为是正式产品名称。
Suggested change
| ChromeOS 和 Chromebook 似乎又要成为 Google 的弃子了,哎 | |
| 新的 Googlebook 能走多远呢? | |
| ChromeOS 和 Chromebook 似乎又要成为 Google 的弃子了,哎 | |
| 新的 Chromebook 能走多远呢? |
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
|
✅ 构建检查完全通过!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated submission from editor.
Files:
Summary by Sourcery
Add a new blog post detailing how to fix ChromeOS captive portal connectivity issues and include associated images for the article.
New Features:
Documentation: