AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-279821

grorel's questions

Martin Hope
grorel
Asked: 2020-02-12 05:56:14 +0800 CST

如何防止 console-getty.service 启动?

  • 1

在我的嵌入式系统上,我使用 linux 内核 4.19.102 和 systemd 240。一切都是使用 buildroot 2019.02.9 生成的。

我使用设备的串行端口输出控制台。

bootargs = "console=ttyS0,115200";

使用我使用的先前版本,控制台方面的一切都很好(buildroot 2018.05,内核 4.16.y 和 systemd 237)。我有以下文件:/etc/systemd/system/getty.target.wants/[email protected]正在启动/sbin/getty -L ttyS0 115200 vt100

现在,控制台打印通常的启动消息,然后打印日志消息两次:

Welcome to MyDevice
MyDevice login:
Welcome to MyDevice
MyDevice login:

当我尝试使用以“r”开头的长密码登录时,我得到如下信息:

Welcome to MyDevice
MyDevice login:
Welcome to MyDevice
MyDevice login: root
Password: r
Login incorrect
MyDevice login:

我希望可以使用 SSH 登录。我已经看到在这个版本中“getty”服务启动了两次:

# ps | grep getty
  988 root     /sbin/getty -L ttyS0 115200 vt100
 1002 root     /sbin/getty -L console 115200 vt100
 1117 root     grep getty

/etc 文件现在是:/etc/systemd/system/getty.target.wants/console-getty.service正在启动/sbin/getty -L console 115200 vt100 但/sbin/getty -L ttyS0 115200 vt100仍在启动。

当我杀死“控制台”服务(与以前的版本处于相同状态)时,我可以登录并且控制台终于好了。

如何配置 buildroot 或 systemd 以阻止控制台服务启动?

systemd getty
  • 1 个回答
  • 1362 Views
Martin Hope
grorel
Asked: 2018-07-18 05:23:54 +0800 CST

新的 IP 地址,而 DHCP 租用时间未到

  • 4

我的嵌入式系统使用 systemd 并通过 DHCP 获取其 IP 地址。如果遵守租用时间,DHCP 服务器使用租用时间为网络上的每台计算机提供相同的 IP 唯一地址。

我的嵌入式系统的网络配置如下:

/etc/systemd/network/dhcp.network

[Match]
Name=eth*

[Network]
DHCP=yes

问题是每次启动时,我都会在系统上获得一个新的 IP 地址。我缺少一些配置吗?

更多信息:

$ cat /proc/version
Linux version 4.16.0 ([email protected]) (gcc version 7.3.0 (Buildroot 2018.05-g0164235-dirty)) #18 SMP PREEMPT Tue Jul 17 14:28:37 CEST 2018  

[编辑] 添加 DHCP 发现包

Frame 13299: 327 bytes on wire (2616 bits), 327 bytes captured (2616 bits) on interface 0  
    Interface id: 0 (\\.\pipe\Shamrock_Wireshark_TAP__30815)  
    Encapsulation type: Ethernet (1)  
    Arrival Time: Jul 16, 2018 10:39:49.166800000 Paris, Madrid (heure d??t?)  
    [Time shift for this packet: 0.000000000 seconds]  
    Epoch Time: 1531730389.166800000 seconds  
    [Time delta from previous captured frame: 20.554641000 seconds]  
    [Time delta from previous displayed frame: 43.658782000 seconds]  
    [Time since reference or first frame: 43.770160000 seconds]  
    Frame Number: 13299  
    Frame Length: 327 bytes (2616 bits)  
    Capture Length: 327 bytes (2616 bits)  
    [Frame is marked: False]  
    [Frame is ignored: False]  
    [Protocols in frame: eth:ethertype:ip:udp:bootp]  
    [Coloring Rule Name: UDP]  
    [Coloring Rule String: udp]  
Ethernet II, Src: AlstomGr_20:00:6f (80:b3:2a:20:00:6f), Dst: Broadcast (ff:ff:ff:ff:ff:ff)  
    Destination: Broadcast (ff:ff:ff:ff:ff:ff)  
        Address: Broadcast (ff:ff:ff:ff:ff:ff)  
        .... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)  
        .... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)  
    Source: AlstomGr_20:00:6f (80:b3:2a:20:00:6f)  
        Address: AlstomGr_20:00:6f (80:b3:2a:20:00:6f)  
        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)  
        .... ...0 .... .... .... .... = IG bit: Individual address (unicast)  
    Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255  
    0100 .... = Version: 4  
    .... 0101 = Header Length: 20 bytes  
    Differentiated Services Field: 0xc0 (DSCP: CS6, ECN: Not-ECT)  
        1100 00.. = Differentiated Services Codepoint: Class Selector 6 (48)  
        .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)  
    Total Length: 313  
    Identification: 0x0000 (0)  
    Flags: 0x00  
        0... .... = Reserved bit: Not set  
        .0.. .... = Don't fragment: Not set  
        ..0. .... = More fragments: Not set  
    Fragment offset: 0  
    Time to live: 64  
    Protocol: UDP (17)  
    Header checksum: 0x78f5 [validation disabled]  
        [Good: False]  
        [Bad: False]  
    Source: 0.0.0.0  
    Destination: 255.255.255.255  
    [Source GeoIP: Unknown]  
    [Destination GeoIP: Unknown]  
User Datagram Protocol, Src Port: 68 (68), Dst Port: 67 (67)  
    Source Port: 68  
    Destination Port: 67  
    Length: 293  
    Checksum: 0xca77 [validation disabled]  
        [Good Checksum: False]  
        [Bad Checksum: False]  
    [Stream index: 0]   
Bootstrap Protocol (Discover)  
    Message type: Boot Request (1)  
    Hardware type: Ethernet (0x01)  
    Hardware address length: 6  
    Hops: 0  
    Transaction ID: 0x240b826b  
    Seconds elapsed: 1  
    Bootp flags: 0x0000 (Unicast)  
        0... .... .... .... = Broadcast flag: Unicast  
        .000 0000 0000 0000 = Reserved flags: 0x0000  
    Client IP address: 0.0.0.0  
    Your (client) IP address: 0.0.0.0  
    Next server IP address: 0.0.0.0  
    Relay agent IP address: 0.0.0.0  
    Client MAC address: AlstomGr_20:00:6f (80:b3:2a:20:00:6f)  
    Client hardware address padding: 00000000000000000000  
    Server host name not given  
    Boot file name not given  
    Magic cookie: DHCP  
    Option: (53) DHCP Message Type (Discover)  
        Length: 1  
        DHCP: Discover (1)  
    Option: (61) Client identifier  
        Length: 19  
        IAID: cd4578d2  
        DUID Type: assigned by vendor based on Enterprise number (2)  
        Enterprise-number: Tom Gundersen (systemd) (43793)  
        Identifier: 871468cb35ae1ddc  
    Option: (55) Parameter Request List  
        Length: 8  
        Parameter Request List Item: (1) Subnet Mask  
        Parameter Request List Item: (3) Router  
        Parameter Request List Item: (12) Host Name  
        Parameter Request List Item: (15) Domain Name  
        Parameter Request List Item: (6) Domain Name Server  
        Parameter Request List Item: (33) Static Route  
        Parameter Request List Item: (121) Classless Static Route  
        Parameter Request List Item: (42) Network Time Protocol Servers  
    Option: (57) Maximum DHCP Message Size  
        Length: 2  
        Maximum DHCP Message Size: 576  
    Option: (12) Host Name  
        Length: 4  
        Host Name: RPH4  
    Option: (255) End  
        Option End: 255
systemd dhcp
  • 1 个回答
  • 1075 Views
Martin Hope
grorel
Asked: 2018-04-26 05:22:25 +0800 CST

Buildroot : 使用 out of tree defconfig

  • 0

我正在使用 tar 映像“buildroot-2018.02.tar.gz”为我的嵌入式系统生成 linux 映像(内核和 fs)。为了确保我需要重新创建项目的最低配置(稍后,在另一台计算机上......),我使用BR UM §8.5中定义的 BR 树。

我已经成功地正确配置了 BR 和 linux 内核,并且我已经创建了两个配置文件:-myProc_defconfig-myProc_linux_defconfig

我正在尝试为我的同事创建一个图像,以便轻松地重新创建项目。现在,我有以下树:

/                                   :   Git root
/README                             :   This very file
/make_buildroot_env.sh              :   Script to set up the development environment  
/myProc_kernel/                     :   Development environment prerequisite    
/myProc_kernel/configs/             :   Contains both BR & Linux configuration files
/myProc_kernel/fs_overlay/          :   Filesystem overlay, contains all applicative files
/myProc_kernel/tools/               :   Scripts and data used by BR
/myProc_kernel/tools/data           :   All data files used by scripts

想法是创建一个脚本,将 buildroot 解压到不同的文件夹中(系统是根据定义的树构建的)并使用 defconfig 文件对其进行配置。

脚本开始如下,从我上面定义的“Git root /”启动:

make_buildroot_env.sh

tar -xaf ./MyProc_kernel/tools/data/buildroot-2018.02.tar.gz
cd buildroot-2018.02
make defconfig BR2_DEFCONFIG=../myProc_kernel/configs/myProc_defconfig
make O=../MyProc_kernel

我这里有两个问题:

  1. 我在最后一次通话中遇到了错误:

Makefile:862: *** 请先配置 Buildroot(例如“make menuconfig”)。停止。

  1. 如果我查看在.configBR 文件夹中创建的文件,它似乎只使用了几个参数MyProc_defconfig

我的问题是:

  • 为什么 BR 总是抱怨错误 1 ​​?应使用指向 defconfig 文件的行进行配置?

  • 我缺少什么来重新创建我的开发环境?

configure buildroot
  • 2 个回答
  • 3923 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve