15AH, San Francisco

California, United States.

Send Your Mail At:

tianyingkejishe@sina.cn

Working Hours

Mon-Sat: 9.30am To 7.00pm

分类标题

Autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et dolore feugait.

分类归档 操作系统

【openwrt】Openwrt配置串口登录密码

Openwrt15.05配置串口登录密码

一、修改busybox

make menuconfig选择

Base system —>
	<*> busybox ……
		[*] Customize busybox option
			Login/Password Management Utilities —>
				[*] getty
				[*] login (NEW)

二、修改启动脚本package/base-files/files/etc/inittab

vim inittab

::askconsole:/bin/ash --login

改为

::askconsole:/bin/login

三、修改 vi target/linux/ramips/base-files/etc/inittab

::askconsole:/bin/ash --login

改为

::askconsole:/bin/login

重新编译。

Openwrt18.06配置串口登录密码

一、修改busybox

make menuconfig选择

Base system —>
	<*> busybox ……
		[*] Customize busybox option
			Login/Password Management Utilities —>
				[*] getty
				[*] login (NEW)

二、修改启动脚本package/base-files/files/usr/libexec

vim login.sh

[ "$(uci -q get system.@system[0].ttylogin)" = 1 ] || exec /bin/ash --login

改为

[ "$(uci -q get system.@system[0].ttylogin)" = 1 ] || exec /bin/login

重新编译。

【Openwrt】实现本地域名访问路由器

一、路由器上修改方式

  vi /etc/hosts

  127.0.0.1 localhost
  192.168.1.1 recologypower.com

二、openwrt编译环境修改方式

 vi package/base-files/files/etc/hosts


  127.0.0.1 localhost
  192.168.1.1 recologypower.com

【Centos】Centos8默认不支持SCTP

一、问题

#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
#include <netinet/sctp.h>
#include <stdio.h>

int main()
{
        int i = socket(AF_INET,SOCK_STREAM,IPPROTO_SCTP);
        printf("huilh:%d\r\n",i);
        return 0;
}

执行后i=-1,通过系统指令checksctp检测,发现system not surpote。

二、解决方式

打开网址:https://centos.pkgs.org/,下载sctp rpm安装包,安装完。

yum -y install kernel-modules-extra

打开/etc/modprobe.d/sctp-blacklist.conf文件,注释掉blacklist sctp。把sctp从黑名单删除。

重启电脑。

【CentOs】安装htop

首先启用 EPEL Repository:

yum -y install epel-release

启用 EPEL Repository 後, 可以用 yum 直接安裝 Htop:

yum -y install htop

gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral] #12

diff --git a/glib/glib/gdate.c b/glib/glib/gdate.c
index 1978cf7..9be9b97 100644
--- a/glib/glib/gdate.c
+++ b/glib/glib/gdate.c
#第一处:2439行修改
@@ -2439,6 +2439,10 @@ win32_strftime_helper (const GDate     *d,
  *
  * Returns: number of characters written to the buffer, or 0 the buffer was too small
  */
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+
 gsize     
 g_date_strftime (gchar       *s, 
                  gsize        slen, 
#第二处:2549行修改
@@ -2549,3 +2553,5 @@ g_date_strftime (gchar       *s,
   return retval;
 #endif
 }
+
+#pragma GCC diagnostic pop