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

给我的 K2 编译 coolsnowwolf 的 lede #28

Open
hanxi opened this issue May 29, 2019 · 25 comments
Open

给我的 K2 编译 coolsnowwolf 的 lede #28

hanxi opened this issue May 29, 2019 · 25 comments

Comments

@hanxi
Copy link
Owner

hanxi commented May 29, 2019

部署 docker 编译环境

可以下载这个 https://github.com/hanxi/lede-docker-builder

如果想自建 docker 镜像,记得把这个环境变量加上。docker 默认是 root 环境。

ENV FORCE_UNSAFE_CONFIGURE=1

make menuconfig 选项配置(基本配置)

  • Target system (目标系统类型,即路由器CPU架构)
  • Subtarget (子目标,即路由器芯片型号)
  • Target Profile (目标文件,即路由器型号)
  • LuCI (LuCI界面设置)

我的是斐讯K2路由器, CPU型号为MT7620, 芯片架构为MIPS, 路由器型号为PSG1218 rev.Ax, 那么我的基本配置就为:

  • Target system -> MediaTek Ralink MIPS
  • Subtarget -> MT7620 based boards
  • Target Profile -> Phicomm PSG128 rev.Ax

之前被误导了,K1 是 PSG1208,K2 是 PSG1218 rev.Ax, K2C是PSG1218 rev.Bx

LuCI配置:

LuCI->
    Modules->
        Translations->
            <*>English (en)
            <*>Chinese (zh-cn)
    Themes->
            <*>luaci-theme-argon

配置完以上信息后, OpenWrt最基本的一些配置已经完成。

make menuconfig 配置选项参考: https://blog.csdn.net/Amosstan/article/details/80135108

加点插件进去

参考下这个配置插件: https://www.right.com.cn/forum/forum.php?mod=viewthread&tid=344825

LuCI ---> Applications ---> luci-app-arpbind  #IP/MAC绑定
LuCI ---> Applications ---> luci-app-autoreboot  #高级重启
LuCI ---> Applications ---> luci-app-ddns   #动态域名 DNS 
LuCI ---> Applications ---> luci-app-firewall   #添加防火墙
LuCI ---> Applications ---> luci-app-ramfree  #释放内存
LuCI ---> Applications ---> luci-app-flowoffload   #Turbo ACC  FLOW转发加速

找回丢失的 $$R

这东西我也就临时用下,比如刷 LineageOS 跳过谷歌认证需要用到。

mkdir ~/lede/package/openwrt-packages
cd ~/lede/package/openwrt-packages
git clone https://github.com/SuLingGG/luci-app-ssr-plus ./luci-app-ssr-plus

再插入这行彩蛋语句到 package/lean/default-settings/files/zzz-default-settings

echo 0xDEADBEEF > /etc/config/google_fu_mode

然后 make menuconfig 把选项加进去

修改 ip 为 192.168.2.1

修改这个文件 package/base-files/files/bin/config_generate 里的 192.168.1.1 为 192.168.2.1

修改默认主题

再插入这几行语句到 package/lean/default-settings/files/zzz-default-settings 修改主题设置

uci batch <<-EOF
    set luci.themes.Argon=/luci-static/argon
    set luci.main.mediaurlbase=/luci-static/argon
    commit luci
EOF

我编译的 K2 的包下载地址: openwrt-ramips-mt7620-psg1218a-squashfs-sysupgrade.bin

选错版本,结果把K1编译出来了,K1的包下载地址 openwrt-ramips-mt7620-psg1208-squashfs-sysupgrade.bin

K2 也能甩刷 K1 的包, 就是无线2.4G基本废掉了,没信号的。

@ntgeralt
Copy link

哈哈,变成issues回复了
那我就提一个吧,我编译的 K2 的包下载地址是空的~

@hanxi
Copy link
Owner Author

hanxi commented May 29, 2019

哈哈,变成issues回复了
那我就提一个吧,我编译的 K2 的包下载地址是空的~

@ntgeralt 已经打包好上传了。

@hanxi
Copy link
Owner Author

hanxi commented May 29, 2019

ip 改为了 192.168.2.1
root 的密码依然是 password

@hanxi
Copy link
Owner Author

hanxi commented May 30, 2019

刷机的朋友吗们请使用 breed 刷机。

@ntgeralt
Copy link

好的

@AnClark
Copy link

AnClark commented Jun 8, 2019

大佬,不介意的话,把你的Docker镜像传到Hub上怎么样呢🥰

@hanxi
Copy link
Owner Author

hanxi commented Jun 8, 2019 via email

@hanxi
Copy link
Owner Author

hanxi commented Jun 9, 2019

@AnClark
Copy link

AnClark commented Jun 9, 2019

这下就方便多了

@fujie-xiyou
Copy link

请教一下,我的k2,选的就是PSG1218 rev.Ax,但是编译出来的固件没有2.4g,是还需要做什么配置吗?

@hanxi
Copy link
Owner Author

hanxi commented Jun 15, 2019

请教一下,我的k2,选的就是PSG1218 rev.Ax,但是编译出来的固件没有2.4g,是还需要做什么配置吗?

其他的都是默认的呀,是不是你的机子型号不对呢?

@fujie-xiyou
Copy link

请教一下,我的k2,选的就是PSG1218 rev.Ax,但是编译出来的固件没有2.4g,是还需要做什么配置吗?

其他的都是默认的呀,是不是你的机子型号不对呢?

机子型号应该没问题,我看背面写的就是1218,而且我刷您编译的k2固件2.4g就是正常的,可否分享下您的.config文件呢?谢谢!

@hanxi
Copy link
Owner Author

hanxi commented Jun 16, 2019

@fujie-xiyou
Copy link

https://gist.github.com/hanxi/549769e9eaf0ff97e68bb6df756d9eb5

@fujie-xiyou

这个文件貌似是传错了?传成k1的了,不过最骚的是这个刷完,5G没了,2.4G有了。。。跟我之前刚好相反,能否麻烦您传一下您的k2的.config文件

@fujie-xiyou
Copy link

https://gist.github.com/hanxi/549769e9eaf0ff97e68bb6df756d9eb5
@fujie-xiyou

这个文件貌似是传错了?传成k1的了,不过最骚的是这个刷完,5G没了,2.4G有了。。。跟我之前刚好相反,能否麻烦您传一下您的k2的.config文件

神了,我在您这个配置文件的基础上,把型号改成k2的,然后编译完2.4和5g都好了,然后我把配置文件删了,重新make menuconfig选k2,其他不动直接编译,完了之后也是可以的,但是之前我这么做完了就不行,真是奇怪啊,不过真是太谢谢您了

@hanxi
Copy link
Owner Author

hanxi commented Jun 17, 2019

你其实可以试试把 .config 文件删掉再试试的

@hzjnet
Copy link

hzjnet commented Jul 30, 2019

root环境会不会有问题啊? 改成非root行吗? 我增加非root用户后加到sudo组,修订目录权限后到make download V=s就提示权限问题,切换到root还是一样的提示,但是完全照这里原文就没问题

@hanxi
Copy link
Owner Author

hanxi commented Jul 30, 2019

root环境会不会有问题啊? 改成非root行吗? 我增加非root用户后加到sudo组,修订目录权限后到make download V=s就提示权限问题,切换到root还是一样的提示,但是完全照这里原文就没问题

试下手动执行这行命令 ENV FORCE_UNSAFE_CONFIGURE=1
你可以把你的报错发出来看看 @hzjnet

@hzjnet
Copy link

hzjnet commented Jul 30, 2019

root环境会不会有问题啊? 改成非root行吗? 我增加非root用户后加到sudo组,修订目录权限后到make download V=s就提示权限问题,切换到root还是一样的提示,但是完全照这里原文就没问题

试下手动执行这行命令 ENV FORCE_UNSAFE_CONFIGURE=1
你可以把你的报错发出来看看 @hzjnet

先谢谢,具体报错内容如下:
$ make download V=s
make[1]: Entering directory `/openwrt/openwrt.coolsd190730'
cd "/openwrt/openwrt.coolsd190730"; git log --format=%h -1 toolchain >

SHELL= flock /openwrt/openwrt.coolsd190730/tmp/.linux-4.14.131.tar.xz.flock -c ' /openwrt/openwrt.coolsd190730/scripts/download.pl "/openwrt/openwrt.coolsd190730/dl" "linux-4.14.131.tar.xz" "19f6404c30f4a9a1fe3315b902676b6d63a470be5d55cf2a0e47983c643c8ff5" "" "@KERNEL/linux/kernel/v4.x" '
/bin/sh: 1: /openwrt/openwrt.coolsd190730/scripts/download.pl: Permission denied
make[3]: *** [/openwrt/openwrt.coolsd190730/dl/linux-4.14.131.tar.xz] Error 126
make[3]: Leaving directory /openwrt/openwrt.coolsd190730/target/linux/ramips' make[2]: *** [download] Error 2 make[2]: Leaving directory /openwrt/openwrt.coolsd190730/target/linux'
time: target/linux/download#0.02#0.04#0.07
make[1]: *** [target/linux/download] Error 2
make[1]: Leaving directory `/openwrt/openwrt.coolsd190730'
make: *** [download] Error 2
$ id
uid=1000(hzjnet) gid=1000(hzjnet) groups=1000(hzjnet),27(sudo)

@hanxi
Copy link
Owner Author

hanxi commented Jul 30, 2019

@hzjnet 你这报错看上去像文件下载的问题,是不是没有科学上网?

/bin/sh: 1: /openwrt/openwrt.coolsd190730/scripts/download.pl: Permission denied
make[3]: *** [/openwrt/openwrt.coolsd190730/dl/linux-4.14.131.tar.xz] Error 126

download.pl 这个脚本报的错误

@hzjnet
Copy link

hzjnet commented Jul 30, 2019

@hzjnet 你这报错看上去像文件下载的问题,是不是没有科学上网?

/bin/sh: 1: /openwrt/openwrt.coolsd190730/scripts/download.pl: Permission denied
make[3]: *** [/openwrt/openwrt.coolsd190730/dl/linux-4.14.131.tar.xz] Error 126

download.pl 这个脚本报的错误

是的 但是这个源码你的root环境下正常 ,而且是Permission denied,sudo情况下也是这个错误

@hanxi
Copy link
Owner Author

hanxi commented Jul 30, 2019

@hzjnet 你这报错看上去像文件下载的问题,是不是没有科学上网?

/bin/sh: 1: /openwrt/openwrt.coolsd190730/scripts/download.pl: Permission denied
make[3]: *** [/openwrt/openwrt.coolsd190730/dl/linux-4.14.131.tar.xz] Error 126

download.pl 这个脚本报的错误

是的 但是这个源码你的root环境下正常

@hzjnet 那应该是 sudo 在 docker 里有问题。docker 里还是直接用 root 用户吧。

@hzjnet
Copy link

hzjnet commented Jul 30, 2019

@hzjnet 你这报错看上去像文件下载的问题,是不是没有科学上网?

/bin/sh: 1: /openwrt/openwrt.coolsd190730/scripts/download.pl: Permission denied
make[3]: *** [/openwrt/openwrt.coolsd190730/dl/linux-4.14.131.tar.xz] Error 126

download.pl 这个脚本报的错误

是的 但是这个源码你的root环境下正常

@hzjnet 那应该是 sudo 在 docker 里有问题。docker 里还是直接用 root 用户吧。

en 谢谢 只是习惯了非root,看来我需要自己折腾一个docker文件再试试

@daidaiworm
Copy link

楼主好,各位大大好。有没有可能编一个包含trojan功能的版本呢。
https://github.com/trojan-gfw/

@hanxi
Copy link
Owner Author

hanxi commented Mar 13, 2020

楼主好,各位大大好。有没有可能编一个包含trojan功能的版本呢。
https://github.com/trojan-gfw/

没有搞过 trojan,K2 的话还是别装这些插件了。你可以去恩山上问问。

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

No branches or pull requests

6 participants