https://github.com/dramalife/note.git
AUTHOR : Dramalife@live.com
Init : 2020.03.19
Update :

转载请注明出处:https://github.com/dramalife/note

本文source url

Cross Compile

https://github.com/dramalife/note.git
AUTHOR : Dramalife@live.com
Init : 2020.03.19
Update :

1 Build

config.log

# warning : sysconfdir -- confdir of target !!!!
./configure --host=arm-linux-gnueabihf --with-sysroot=/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf --disable-nhrpd --prefix=/home/dramalife/prefix_quagga/usr/local --sysconfdir=/home/dramalife/prefix_quagga/usr/local/etc --enable-vtysh --enable-user=root --enable-group=root --enable-vty-group=root

1.1 configure - libreadline

1.1.1 ErrMsg

not found

configure: error: vtysh needs libreadline but was not found and usable on your system.
1.1.2 config.log
# Error - configure
configure:18303: checking for main in -lreadline
configure:18322: arm-linux-gnueabihf-gcc -o conftest -g -O2 -g -Os -fstack-protector-strong --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fpie -fno-omit-frame-pointer -Wall -Wextra -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers conftest.c -lreadline >&5
/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lreadline
collect2: error: ld returned 1 exit status
1.1.3 Solve
# Download source code
wget https://mirrors.sjtug.sjtu.edu.cn/gnu/readline/readline-8.0.tar.gz # Install to sysroot of cross_tool, for compilation.
./configure --host=arm-linux-gnueabihf --prefix=/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf
# Install to target rootfs, for runtime.
./configure --host=arm-linux-gnueabihf --prefix=/home/dramalife/prefix_quagga make
sudo make install

1.2 configure - libncurses

1.2.1 ErrMsg

found but not usable !

configure: error: vtysh needs libreadline but was not found and usable on your system.
1.2.2 config.log
$ arm-linux-gnueabihf-gcc -o conftest -g -O2 -g -Os -fstack-protector-strong --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fpie -fno-omit-frame-pointer -Wall -Wextra -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers   conftest.c -L=/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/lib -lreadline
/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/lib/libreadline.so: undefined reference to `tputs'
/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/lib/libreadline.so: undefined reference to `tgoto'
/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/lib/libreadline.so: undefined reference to `tgetflag'
/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/lib/libreadline.so: undefined reference to `UP'
/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/lib/libreadline.so: undefined reference to `tgetent'
/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/lib/libreadline.so: undefined reference to `tgetnum'
/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/lib/libreadline.so: undefined reference to `PC'
/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/lib/libreadline.so: undefined reference to `tgetstr'
/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/lib/libreadline.so: undefined reference to `BC'
collect2: error: ld returned 1 exit status
1.2.3 Solve
# Download source code
wget https://mirrors.sjtug.sjtu.edu.cn/gnu/ncurses/ncurses-6.2.tar.gz # Install to sysroot of cross_tool, for compilation.
./configure --host=arm-linux-gnueabihf --prefix=/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf
# Install to target rootfs, for runtime.
./configure --host=arm-linux-gnueabihf --prefix=/home/dramalife/prefix_quagga make
sudo make install

1.3 libtool - libcares (optional)

1.3.1 ErrMsg
libtool: warning: library '/usr/local/lib/libcares.la' was moved.
libtool: warning: library '/usr/local/lib/libcares.la' was moved.
/usr/local/lib/libcares.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:475: recipe for target 'nhrpd' failed
make[2]: *** [nhrpd] Error 1
make[2]: Leaving directory '/home/dramalife/temp/quagga-1.2.4/nhrpd'
Makefile:467: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/dramalife/temp/quagga-1.2.4'
Makefile:399: recipe for target 'all' failed
make: *** [all] Error 2
1.3.2 Solve
# Download source code
wget https://c-ares.haxx.se/download/c-ares-1.15.0.tar.gz # Install to sysroot of cross_tool, for compilation.
./configure --host=arm-linux-gnueabihf --prefix=/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf
# Install to target rootfs, for runtime.
./configure --host=arm-linux-gnueabihf --prefix=/home/dramalife/prefix_quagga make
sudo make install

2 Install

root@Raisecom:/# cp /usr/local/lib/libzebra.* /lib
root@Raisecom:/# zebra --version
zebra version 1.2.4
Copyright 1996-2005 Kunihiro Ishiguro, et al.
configured with:
--host=arm-linux-gnueabihf --with-sysroot=/usr/local/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf --disable-nhrpd --prefix=/home/dramalife/prefix_quagga/usr/local --sysconfdir=/home/dramalife/prefix_quagga/usr/local/etc --enable-vtysh --enable-user=root --enable-group=root --enable-vty-group=root
root@Raisecom:/# uname -a
Linux Raisecom 4.1.15 #1 SMP PREEMPT Wed Jan 8 09:38:46 CST 20 armv7l GNU/Linux
root@Raisecom:/# cat /etc/issue
Freescale i.MX Release Distro 4.1.15-2.1.0 \n \l root@Raisecom:/#

3 Exec

root@Raisecom:/# telnet 127.0.0.1 01

Entering character mode
Escape character is '^]'. Hello, this is Quagga (version 1.2.4).
Copyright 1996-2005 Kunihiro Ishiguro, et al. User Access Verification Password:
Router>
Router> enable
Password:
Password:
Router#
Router#
clear Clear stored data
configure Configuration from vty interface
copy Copy configuration
debug Debugging functions (see also 'undebug')
disable Turn off privileged mode command
echo Echo a message back to the vty
enable Turn on privileged mode command
end End current mode and change to enable mode.
exit Exit current mode and down to previous mode
help Description of the interactive help system
list Print command list
logmsg Send a message to enabled logging destinations
no Negate a command or set its defaults
quit Exit current mode and down to previous mode
show Show running system information
terminal Set terminal line parameters
who Display who is on vty
write Write running configuration to memory, network, or terminal
Router#

Native compile

https://github.com/dramalife/note.git
AUTHOR : Dramalife@live.com
Init : 2019.01.21
Update : ... ...
Update : 2020.03.19
Update :

1 Build

1.1 Error1 - libreadline

error: vtysh needs libreadline but was not found and usable on your system.

sudo apt-get install libreadline-dev

1.2 Error2 - libtool version

missing: line 81: aclocal-1.15: command not found

libtool: Version mismatch error. This is libtool 2.4.2 Debian-2.4.2-1.7ubuntu1, but the

libtool: definition of this LT_INIT comes from libtool 2.4.6.

autoreconf --force --install

1.3 Error3 - libtool

# Ref : https://blog.csdn.net/github_29989383/article/details/51886234
#
# libtool: Version mismatch error. This is libtool 2.4.2 , but the
# libtool: definition of this LT_INIT comes from libtool 2.4.6.
# libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2
# libtool: and run autoconf again # make maintainer-clean 清理干净后,在运行上面的命令
autoreconf --force --install
./configure
make

2 install&runquagga

./configure --enable-vtysh --enable-user=root --enable-group=root --enable-vty-group=root

make

sudo make install

zebra: error while loading shared libraries: libzebra.so.1: cannot open shared object file: No such file or directory

sudo cp /usr/local/lib/libzebra.so* /usr/lib

3 Exec

# /etc/services    #zebra  2601/tcp  #zebra vty
sudo zebra -d
telnet 7.0.0.1 2601
# usr:admin passwd:zebra,,,enablepasswd:zebra

quagga/zebra - 交叉编译(cross)和本地编译(native)的更多相关文章

  1. .NET跨平台之旅:在Linux上以本地机器码(native)运行ASP.NET Core站点

    在将“.NET跨平台之旅”示例站点 about.cnblogs.com 从 ASP.NET 5 RC1 升级至 ASP.NET Core 1.0 (博文链接)之后,我们有一个难以抗拒的冲动 —— 体验 ...

  2. 【转】用串口登录Beaglebone Black、用usb共享电脑网络、内核模块的本地编译

    原文网址:http://bbs.eeworld.com.cn/thread-431507-1-1.html 串口连接BBB使用usb线可以连接BBB和电脑,用ssh就可以登录BBB来进行操作.但有时候 ...

  3. Sql server2014 内存优化表 本地编译存储过程

    参考文献:http://www.infoq.com/cn/news/2013/09/Compiled-Queries http://www.bianceng.cn/database/SQLServer ...

  4. oracle本地编译问题

    oracle10.2: --将过程重新编译为本地编译方式,提示有编译错误,经查提示未设置plsql_native_library_dir 参数 SQL> alter procedure p_xx ...

  5. (OK) Installing Quagga—zebra—configure—make—CentOS7

    -------------------Installing Quagga # tar xzf quagga-0.99.21mr2.2.tar.gz # cd quagga-0.99.21mr2.2 / ...

  6. maven项目引入外部第三方jar包,引入、本地编译、第三方jar一起打到jar中、在linux机器中解决classnotfound(配置classpath),笔记整理。

    文章目录 引用的第三方jar的目录结构(示例) 引入第三方jar进行dependency使项目内能import 本地编译 第三方jar一起打到jar中 在linux机器中解决classnotfound ...

  7. Chrome 插件: 起动本地应用 (Native messaging)

    Chrome 插件: 起动本地应用 (Native messaging) www.MyException.Cn  网友分享于:2014-08-01  浏览:3次   Chrome 插件: 启动本地应用 ...

  8. Chrome 小工具: 启动本地应用 (Native messaging)

    最近遇到一个新的问题.需要使用Chrome 插件, 从我们对我们当地的一个网站之一启动C#应用,同时通过本申请值执行不同的操作. 在这里记录下解决的过程.以便以后查找 首先我们须要新建一个google ...

  9. Apollo-3.0本地编译

    Apollo-3.0本地编译 用docker编译所用的dev.x86_64.dockerfile文件(具体位置在apollo/docker/build)中有所有的依赖库或包, 还会执行一些shell脚 ...

随机推荐

  1. 三年无限流量免费随身WiFi充电宝是真的还是套路?

    一般来说大家现在看到"无限流量"."免费"等字眼,总会有一种"这是陷阱"."这是大坑"."就要黑你钱" ...

  2. 测试一个数字是否等于 NaN

    ES6提供了一个新的 Number.isNaN() 函数,这是一个不同的函数,并且比老的全局 isNaN() 函数更可靠.

  3. python基础局部变量、全局变量

    局部变量的作用域只作用与当前函数块(或代码块)中,对函数块(或代码块)之外的重名变量,没有任何影响. 在函数块(或代码块)中,局部变量可用通过global关键字声明变量来改变在函数块(或代码块)之外对 ...

  4. ajax学习相关

    choices参数 当存在某个字段的值只有有限的几个时,如性别(只有男.女),婚否(已婚.未婚)等,这种情况,我们可以用数字来代替这些中文字符,可以减轻数据库的负担,这时,就需要用到choices参数 ...

  5. LVS+Keepalived 配置

    LVS+Keepalived配置 环境准备 LVS1:192.168.1.1 LVS2:192.168.1.2 MySQL Server1:192.168.1.13 MySQL Server2:192 ...

  6. 查漏补缺:进程间通信(IPC):管道

    管道是UNIX系统IPC的最古老形式,所有UNIX系统都提供此种通信机制.管道有以下两种局限性: (1)历史上,管道是半双工的(即数据只能在一个方向上流动). (2)管道只能在具有公共先祖的两个进程之 ...

  7. USB描述符(转)

    //============================================================================// 文件名: USBDESC.C// 用 ...

  8. C:指针习题

    1. 请指出以下程序段中的错误. 程序中的错误有:(1)p=i:类型不匹配.(2)q=*p:q 是指针,*p 是指针 p 指向变量的值.(3)t='b':t 是指针类型. 解释:指针变量是一种存放地址 ...

  9. Git的安装与TortoiseGit的安装和汉化

    下载Git 进入https://git-scm.com/downloads 可以看到如下界面 因为我是windows系统,选择windows即可. 有的朋友因为网络慢的一些原因不能很快下载下来,可以进 ...

  10. C语言链表的基本操作

    */ * Copyright (c) 2016,烟台大学计算机与控制工程学院 * All rights reserved. * 文件名:text.cpp * 作者:常轩 * 微信公众号:Worldhe ...