Skip to content
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

openwrt 换源失败 #153

Open
1 task done
happy-game opened this issue Dec 14, 2024 · 4 comments
Open
1 task done

openwrt 换源失败 #153

happy-game opened this issue Dec 14, 2024 · 4 comments
Assignees
Labels
Bug 存在缺陷 Linux Linux相关 os_target os target
Milestone

Comments

@happy-game
Copy link
Collaborator

你操作了什么?

chsrc set openwrt https://test.com

发生了什么?

换源失败, 使用了错误的换源方式.

本应该怎么样?

我希望chsrc可以帮我成功换源.

chsrc 版本

v0.1.9.6-2024/12/13

你使用的是哪个操作系统?

Linux

OS 版本 / OS 发行版

openwrt x86_64

Log 输出

选中镜像站: 用户自定义 (user)
--------------------------------
[chsrc 备份] /etc/opkg/distfeeds.conf -> /etc/opkg/distfeeds.conf.bak
[chsrc 运行] apt update
sh: apt: not found
[chsrc 运行] x 命令执行失败,退出状态: 32512
chsrc: 关键错误,强制结束

防止重复问题

  • 我已在项目的 GitHub 和 Gitee 两个仓库分别搜索过类似的 issue
@happy-game happy-game added Bug 存在缺陷 os_target os target Linux Linux相关 labels Dec 14, 2024
@happy-game
Copy link
Collaborator Author

openwrt的包管理器应该是opkg, 此外

char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*downloads.openwrt.org@", source.url, "@g' " OS_OpenWRT_SourceConfig);

处不应该使用 https?://.*downloads.openwrt.org, 这样不利于重置源以及更换为新源.

openwrt的初始源文件示例如下:

src/gz openwrt_core https://downloads.openwrt.org/releases/21.02.0/targets/rockchip/armv8/packages
src/gz openwrt_base https://downloads.openwrt.org/releases/21.02.0/packages/aarch64_generic/base
src/gz openwrt_luci https://downloads.openwrt.org/releases/21.02.0/packages/aarch64_generic/luci
src/gz openwrt_packages https://downloads.openwrt.org/releases/21.02.0/packages/aarch64_generic/packages
src/gz openwrt_routing https://downloads.openwrt.org/releases/21.02.0/packages/aarch64_generic/routing
src/gz openwrt_telephony https://downloads.openwrt.org/releases/21.02.0/packages/aarch64_generic/telephony

所以感觉可以这么替换:

sed 's|http.*releases|https://test.com|g' /etc/opkg/distfeeds.conf

ccmywish added a commit that referenced this issue Dec 14, 2024
@ccmywish ccmywish added this to the v0.2.0 milestone Dec 14, 2024
ccmywish added a commit that referenced this issue Dec 14, 2024
[GitHub #153]

Co-authored-by: happy game <happygame1024@gmail.com>
@ccmywish
Copy link
Contributor

已修复 71d6c68

可以重新试试

@happy-game
Copy link
Collaborator Author

还是有点问题

char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/releases@", source.url, "@g' " OS_OpenWRT_SourceConfig);

这个 cmd没有运行, 但是运行了以后还是有点问题, 正则表达式应该也有点问题.

我来修复这个问题吧, 我这里有可以调试的设备.

@happy-game
Copy link
Collaborator Author

该问题目前已修复, 由于我目前只测试了 x86_64mips架构的openwrt, 其中mips设备由于资源受限无法安装gcc编译没有测试.

欢迎 openwrt用户试用并反馈问题.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 存在缺陷 Linux Linux相关 os_target os target
Projects
None yet
Development

No branches or pull requests

2 participants