查看openwrt内核版本:cat /proc/version 、uname -r
生成配置文件 : config_generate
查看DHCH 已经分配的IP cat /var/dhcp.leases
分割cat /tmp/dhcp.leases ,获取
int get_net_arp_list(char* dst_arp_list)
{
FILE *f=NULL;
//char buf[BUF_SIZE_1024] = {0};
//char *buf = NULL;
//buf = (char*)malloc(sizeof(char)*1024);
if ((f = fopen("/proc/net/arp", "r")) != NULL)
{
fread(dst_arp_list,1,sizeof(char)*1024,f);
//buffer = buf;
//dst_dhcp_list = buf;
my_printf(LOG_MODE_LEVEL_1, "%s(%d) dst_arp_list is %s \n",__FUNCTION__,__LINE__,dst_arp_list);
fclose(f);
}
return 0;
}
7621 不死uboot https://breed.hackpascal.net/
linux系统默认路由表可在cat /etc/iproute2/rt_tables中查看
在openwrt中安装使用 lsusb 查看 USB 设备
opkg install usbutils
更改时区设置文件,设置系统时区为上海时区
#vi /etc/config/system
option timezone Asia/Shanghai
option timezone CST-8
openwrt 串口登录密码
make menuconfig选择
Base system —>
<*> busybox ……
[*] Customize busybox optionLogin/Password Management Utilities —>
[*] login (NEW)
二、修改启动脚本/package/base-files/files/etc/inittab
1 2 3 4 |
|
三、修改 vi target/linux/ipq806x/base-files/etc/inittab
1 |
|
四、root密码默认设置
1 2 3 |
|
从/etc/shadow文件,复制到源码。
ar8031.c -> at803x.c
/NXP/feiling/openwrt/build_dir/toolchain-aarch64_generic_gcc-5.5.0_musl/linux-4.9.63/drivers/net/phy
5.2在源代码中设置IP
系统在启动的时候,会通过运行config_generate这个脚本程序来设置IP等基本参数。该脚本文件位于系统源码的openwrt /package/base-files/files/bin目录
#cd ./package/base-files/files/bin
#vim config_generate