一半君的总结纸

听话只听一半君

Compile aria2 1.34.0 for synology ds212+ with entware-ng toolchain

lz的中古机型synology ds212+因为太老(DSM 6.2还停留在kernel 2.6.32),被entware项目遗弃了(新项目armv5只支持2.6.36的以上kernel),已经停止更新的entware-ng的repo里面只有aria2 1.33.0, 所以 …

MIPS feed uses GCC 4.8.5, uClibc-ng 1.0.16 and kernel 2.6.22.19 slightly modified in wl500g project,
ARMv7 feed uses GCC 4.8.5, Glibc 2.22 and vanilla 2.6.36 LTS kernel,
ARMv5, x86, x64 feeds are on GCC 4.8.5, Glibc 2.22 and vanilla 2.6.32 LTS kernel.

$ podman run -it noonien/openwrt-buildroot bash
sudo apt-get install vim

git clone https://github.com/Entware-ng/Entware-ng.git
cd Entware-ng
make package/symlinks

# ds212+的cpu是Marvell Kirkwood 88F6282
cp configs/armv5.config .config
sudo apt-get install vim rsync

# 原来是1.33.0 改成1.34.0, hash改成
3a44a802631606e138a9e172a3e9f5bcbaac43ce2895c1d8e2b46f30487e77a3
vim feeds/packages/net/aria2/Makefile

make tools/install
make toolchain/install
make target/compile
# make package/compile
make package/aria2/compile

# 编译完成之后
...
Packaged contents of /home/openwrt/Entware-ng/build_dir/target-arm_xscale_glibc-2.23_eabi/aria2-1.34.0/ipkg-armv5soft/aria2 into /home/openwrt/Entware-ng/bin/targets/armv5soft/generic-glibc/packages/aria2_1.34.0-1_armv5soft.ipk

# 把ipk文件拷出来
podman cp goofy_rubin:/home/openwrt/Entware-ng/bin/targets/armv5soft/generic-glibc/packages/aria2_1.34.0-1_armv5soft.ipk ~/Downloads

make toolchain的时候有出错, 根据参考,改成xloc.file[0] == ‘\0’

/home/openwrt/Entware-ng/build_dir/toolchain-arm_xscale_gcc-6.3.0_glibc-2.23_eabi/gcc-6.3.0/gcc/ubsan.c: In function 'bool ubsan_use_new_style_p(location_t)':
/home/openwrt/Entware-ng/build_dir/toolchain-arm_xscale_gcc-6.3.0_glibc-2.23_eabi/gcc-6.3.0/gcc/ubsan.c:1474:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
       || xloc.file == '\0' || xloc.file[0] == '\xff'
                       ^~~~
Makefile:1085: recipe for target 'ubsan.o' failed

把编译出来的可执行文件拷到nas上测试

root@DiskStation:/opt/bin# which aria2c
/opt/bin/aria2c

root@DiskStation:/opt/bin# ps aux | grep -i aria2
root      8455  0.0  0.4  10348  2408 ?        Rs   Oct01   0:02 aria2c --conf-path=/opt/etc/aria2.conf
root     12335  0.0  0.2   4760  1036 pts/1    S+   13:06   0:00 grep --color=auto -i aria2

root@DiskStation:/opt/bin# kill -9 8455

# 把ipk文件拷到nas上
root@DiskStation:/volume1/downloads# opkg install aria2_1.34.0-1_armv5soft.ipk 
Upgrading aria2 on root from 1.33.0-1 to 1.34.0-1...
Configuring aria2.
Collected errors:
 * resolve_conffiles: Existing conffile /opt/etc/aria2.conf is different from the conffile in the new package. The new conffile will be placed at /opt/etc/aria2.conf-opkg.

# 然后启动新版aria2
root@DiskStation:/volume1/downloads# aria2c --conf-path=/opt/etc/aria2.conf

lz把准备toolchain的步骤放到了dockerfile里,只要运行以下命令即可得到entware-ng 1.2.1 toolchain环境

podman build https://github.com/oglops/entware-ng-toolchain.git -t entware-ng-toolchain

podman run --name tomato -ti entware-ng-toolchain bash
# 如果需要别的arch, 可以指定 --build-arg arch=x64 名字是https://github.com/Entware/Entware-ng/tree/master/configs下的文件名

# 也可以直接下build好的
podman run --name tomato -ti quay.io/oglop/entware-ng-toolchain bash

备忘: sudo -i 可以切换成root
update:
10/05/2019 发现upstream升级到了1.35.0,所以lz也跟着升级了

参考:
Error while building gcc-6.3.0/gcc/ubsan.c:1474:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
https://github.com/Entware/Entware-ng/wiki
https://pkg.entware.net/binaries/armv5/Packages.html

下载:
docker pull quay.io/oglop/openwrt-buildroot-entware-ng
mega.nz 网盘地址: 编译时候产生的其他ipk放这里了
https://mega.nz/#F!oeRTGIQQ!PMBj3ApkPHUbcjzNCWqS8Q

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google photo

You are commenting using your Google account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s

%d 博主赞过: