【新唐NUV972开发笔记】开发板环境搭建系列(未完结)

8、共享配置

ifconfig eth0 192.168.4.10 netmask 255.255.255.0
route add default gw 192.168.4.1
echo nameserver 192.168.4.1 >/etc/resolv.conf
echo “1” > /proc/sys/net/ipv4/ip_forward
export XTABLES_LIBDIR=/lib/xtables
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

7、启动文件

mount -o remount rw /
ifconfig usb0 169.254.126.100 netmask 255.255.255.0 up
ifconfig eth0 192.168.2.249 netmask 255.255.255.0 up
mount -t nfs -o nolock 192.168.2.250:/srv/nfs4 /mnt
mount -t nfs -o nolock 192.168.100.134:/nfsroot /mnt

6、固件烧写
Image Name
Image Type
Image encrypt
Image start offset
u-boot-spl.bin
uBoot
Disable
0x 200 Image execute address
u-boot.bin
Data
Disable
0x 100000
env.txt
Environment
Disable
0x 80000
970uimage
Data
Disable
0x 200000
rootfs_yaffs2
Data
Disable
0x 2000000

5、文件系统制作

mkyaffs2 --inband-tags -p 2048 rootfs rootfs.img
4、移植QT
1、tslib-1.1.tar.gz

rm -rf /usr/local/tslib
mkdir -p /usr/local/tslib
chmod 777 /usr/local/tslib
./autogen.sh
./configure CC=arm-linux-gcc CXX=arm-linux-g++ --host=arm-linux --prefix=/usr/local/tslib ac_cv_func_malloc_0_nonnull=yes
make
make install
2、修改 usr/local/tslib/etc/ts.conf 文件,将 module_raw input 前面的#注释去掉。
3、将 usr/local/tslib/文件夹整体复制到开发板上,路径与 pc 端一致,也是usr/local/tslib/

cp -rf /usr/local/tslib /home/qlqcetc/nuc970bsp/rootfs_ssh/usr/local/
4、修改开发板的环境变量

vi /etc/profile

export TSLIB_CONFFILE=/usr/local/tslib/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/tslib/lib/ts
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CALIBFILE="/usr/local/tslib/etc/pointercal"
export TSLIB_CONSOLEDEVICE=“none”
export PATH= P A T H : / u s r / l o c a l / t s l i b / b i n e x p o r t P A T H = PATH:/usr/local/tslib/bin export PATH= PATH:/usr/local/tslib/binexportPATH=PATH:/usr/local/tslib/lib
5、校准测试

ts_calibrate 校准
ts_test 测试
3、移植第三方库:
1、curl-7.57.0.tar.gz

./configure --prefix=/home/qlqcetc/ctools/curl --host=arm-linux make make install
2、openssl-1.0.2n.tar.gz

./config --prefix=/home/qlqcetc/ctools/openssl no-asm shared no-async --cross-compile-prefix=arm-linux- make make install
3、boost_1_61_0.tar.bz2

./bootstrap. sh --prefix=/home/qlqcetc/ctools/boost
vi project-config.jam 修改该文件的一行(指定自己的编译器):
using gcc : : /usr/local/arm-linux-bin/arm-inux-gcc ;
./bjam
./bjam install
4、log4cplus-1.2.1.tar.bz2

./configure --prefix=/home/qlqcetc/ctools/log4cplus --host=arm-linux --enable-static CXXFLAGS="-std=c++0x"
make
make install
5、protobuf-2.5.0.tar.gz

./configure --prefix=/home/qlqcetc/ctools/protobuf --host=arm-linux --with-protoc
make
make install
6、tslib-1.15.tar.gz

./configure --prefix=/home/qlqcetc/ctools/tslib --host=arm-linux
make
make install
2、移植gdb调试
1、安装ncurse 库的移植

./configure --host=arm-linux --prefix=/home/qlqcetc/ctools/ncurses --without-ada --enable-termcap --with-shared
make
make install
2、安装移植GDB

sudo apt-get install texinfo
sudo apt-get install libncurses5-dev
sudo apt-get install m4
sudo apt-get install flex
sudo apt-get install bison
./configure --host=arm-linux --target=arm-linux --enable-shared --prefix=/home/qlqcetc/ctools/gdb --without-x make make install
3、使用GDB

./gdbserver 192.168.2.250:20001 controller
1、移植ssh
1、/home/arm 下新建目录 sshwork,并且将源码复制到该目录下,在/home/arm/sshwork 下新建目录 lib,用来保存生成的库文件。

mkdir /home/arm/sshwork
#cp zlib-1.2.3.tar.gz openssl-0.9.8d.tar.gz openssh-4.6p1.tar.gz /home/arm/sshwork
mkdir /home/arm/sshwork/lib
2、 编译 zlib

./configure -prefix=/home/arm/sshwork/lib/zlib-1.2.3
修改 Makefile :

CC=gcc 改为: CC=arm-linux-gcc
LDSHARED= gcc 改为: LDSHARED=arm-linux-gcc
CPP= gcc - E 改为: CPP=arm-linux-gcc - E
AR= ar rc 改为: AR=arm-linux-ar rc
编译安装:

make
make install
3、编译 openssl

./Configure --prefix=/home/arm/sshwork/lib/openssl-0.9.8d os/compiler:arm-linux-gcc
make
make install
4、 编译 openssh

./configure -host=arm-linux -with-libs -with-zlib=/home/arm/sshwork/lib/zlib-1.2.3-with-ssl-dir=/home/arm/sshwork/lib/openssl-0.9.8d -disable-etc-default-login CC=arm-linux-gcc AR=arm-linux-ar
make
5、修改sshd_config

#PermitRootLogin yes 改为 PermitRootLogin yes
#UseDNS yes 改为 UseDNS no
6、拷贝文件(rootfs_ssh/ 文件系统根目录)

mkdir /home/qlqcetc/nuc970bsp/rootfs_ssh/usr/sbin
mkdir /home/qlqcetc/nuc970bsp/rootfs_ssh/usr/local/bin
mkdir /home/qlqcetc/nuc970bsp/rootfs_ssh/usr/local/libexec
mkdir /home/qlqcetc/nuc970bsp/rootfs_ssh/usr/local/etc
cp sshd /home/qlqcetc/nuc970bsp/rootfs_ssh/usr/sbin
cp scp sftp ssh ssh-add ssh-agent ssh-keygen ssh-keyscan /home/qlqcetc/nuc970bsp/rootfs_ssh/usr/local/bin
cp sftp-server ssh-keysign /home/qlqcetc/nuc970bsp/rootfs_ssh/usr/local/libexec
cp sshd_config ssh_config /home/qlqcetc/nuc970bsp/rootfs_ssh/usr/local/etc
7、在开发板上新建 sshd 工作目录:

mkdir -p /home/qlqcetc/nuc970bsp/rootfs_ssh/var/run
mkdir -p /home/qlqcetc/nuc970bsp/rootfs_ssh/var/empty/sshd
chmod 755 /home/qlqcetc/nuc970bsp/rootfs_ssh/var/empty
8、在主机 openssh-4.6p1 目录下生成密钥相关的文件:

ssh-keygen -t ecdsa -f ssh_host_ecdsa_key -N “”
ssh-keygen -t rsa -f ssh_host_rsa_key -N “”
ssh-keygen -t dsa -f ssh_host_dsa_key -N “”

cp ssh_host_* /home/qlqcetc/nuc970bsp/rootfs_ssh/usr/local/etc
chmod 0644 /home/qlqcetc/nuc970bsp/rootfs_ssh/usr/local/etc/*
chmod 0600 ssh_host_dsa_key ssh_host_key ssh_host_rsa_key
9、在/etc/passwd 中添加下面这一行

sshd❌74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
10、测试:(先在开发板中更改root密码)

passwd root
mkdir /dev/pts
mount devpts /dev/pts -t devpts
/usr/sbin/sshd

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

MacianYuan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值